直接在views里面使用$this->method(),如
controller里面:
Class PostController extends Ccontroller
{
Puvlic function actionList(){....}
Public function getTitle(){return 'test title';}
}
views的list.php
<?php echo $this->getTitle();?>
这样就可以调用本controller的方法了
直接在views里面使用$this->method(),如
controller里面:
Class PostController extends Ccontroller
{
Puvlic function actionList(){....}
Public function getTitle(){return 'test title';}
}
views的list.php
<?php echo $this->getTitle();?>
这样就可以调用本controller的方法了