What is the best way to make calls to different actions in the same page? On my index page I may want to call sayhiAction within that page.
Also, what is the best way to use Zend_View in the case where noViewRenderer = true.
My index controller looks like this, should I extend Zend_View so I don't have to set the script path in every action or is there a better way to do this?
PHP Code:
class IndexController extends Zend_Controller_Action
{
public function indexAction()
{
$view = new Zend_View();
$view->setScriptPath('../application/views/scripts');
$view->title = "Welcome";
$view->content = "Hello, World!";
echo $view->render('main.phtml');
}
public function redirectAction(){
$this->_redirect('/');
}
public function sayhiAction(){
return "Hi";
}
}
Thanks for the help.