Cake 2.x で動作するトリミング ツール コンポーネントとヘルパーがありますが、このトリミング ツールを CakePHP 1.3 の古いプロジェクトの 1 つに使用する必要があります。どうすればいいですか?
コンポーネント:
<?php
App::uses('Component', 'Controller');
class JcropComponent extends Component {
public $components = array('Session');
public $options = array(
'overwriteFile' => true,
'boxWidth' => '940'
);
/**
* Constructor
*/
public function __construct(ComponentCollection $collection, $options = array()) {
parent::__construct($collection,$options);
$this->options = array_merge($this->options, $options);
}
?>
ヘルパー
<?php
App::uses('AppHelper', 'View/Helper');
class JcropHelper extends AppHelper {
public $helpers = array('Html','Form','Js');
public $options = array(
'tooltip' => true,
'boxWidth' => '940'
);
public function __construct(View $view, $options = null) {
parent::__construct($view,$options);
$this->options = array_merge($this->options, $options);
}
?>
これに変更しようとしましたが、画像を表示できますが、オプション配列をマージするにはどうすればよいですか? __construct ($options = array()) の場所
<?php
class JcropComponent extends Component {
var $components = array('Session');
public $options = array(
'overwriteFile' => true,
'boxWidth' => '940'
);
//public function initialize(&$controller, $settings = array()) {
// $this->controller =& $controller;
//parent::__construct($collection,$options);
//$this->options = array_merge($this->options, $options);
//}
?>
<?php
class JcropHelper extends AppHelper {
var $helpers = array('Html','Form','Js');
public $options = array(
'tooltip' => true,
'boxWidth' => '940'
);
public function __construct($settings = null) {
//parent::__construct($view,$options);
//$this->options = array_merge($this->options, $options);
}
?>