Here's some simple test code showing init() being called twice.
<?php
class MyTestController extends Zend_Controller_Action
{
public function init()
{
parent::init();
echo 'MyTest controller initialized<br />';
}
public function preDispatch()
{
// disable view script rendering for all actions
$this->_helper->viewRenderer->setNoRender(true);
// disable layout for testing
$this->_helper->layout->disableLayout(true);
}
public function indexAction()
{
echo 'index action called<br />';
// also render search action
echo $this->view->action('search', 'my-test', 'default', array());
}
public function searchAction()
{
echo 'search action called<br />';
}
}
MyTest controller initialized
index action called
MyTest controller initialized
search action called
-Hector
没有评论:
发表评论