如何在Zend框架中调用控制器功能?
问题描述:
在Zend Framework中,我有一个控制器
In Zend Framework, I have one controller
class TestController extends Zend_Controller_Action
{
public function indexAction()
{
}
public function getResultByID( $id )
{
return $id;
}
}
如何调用函数getResultByID在index.phtml?
How can I call the function getResultByID in index.phtml ?
答
第一个:
public function indexAction()
{
$this->view->controller = $this
}
在您的检视指令码中:
<html><title><?php echo $this->controller->getResultByID($this->id); ?></title></html>