0

私は2つのオプション(インターネットで見つけることができます)を試しましたが、進歩はありませんでした:

//in controller
$show_all = TRUE;
$view->assignRef('show', $show_all);
//in default.php and viev.html.php
$this->show;
//result
Notice: Undefined property: componentViewcomponent::$show


//in controller
$show_all = TRUE;
$view->assign('show', $show_all);
//in default.php and viev.html.php
$this->get('show');
//result
NULL
4

1 に答える 1

1
$model  = $this->getModel('mymodel'); //get the model
$data_list = $model->getSomeData();//get data from the model
$view = $this->getView('view_name', 'html'); // get the view
$view->assignRef('data_list', $data_list); // set the data to the view
$view->display(); // show the view

これは私が過去1年間使用しているもので、常に機能しています。

于 2012-10-31T05:19:38.993 に答える