Databases Reference
In-Depth Information
add the noRouteAction() method to the IndexController.php , it redirects
our request of redbook/toc to the main page.
Example 3-6 Redirect request
<?php
Zend::loadClass('Zend_Controller_Action');
class IndexController extends Zend_Controller_Action
{
public function indexAction()
{
echo 'what should I do?';
}
public function noRouteAction()
{
$this → _redirect('/');
}
}
?>
c. Now, let us create the RedbookController.php as shown in Example 3-7.
We have an indexAction() method for non-existent action request and
tocAction() for our redbook/toc request.
Example 3-7 RedbookController.php
<?php
Zend::loadClass('Zend_Controller_Action');
class FooController extends Zend_Controller_Action
{
public function indexAction()
{
echo 'What should I do?';
}
public function tocAction()
{
echo 'TOC of this topic follows';
}
public function __call($action, $arguments)
{
echo 'RedbookController:__call()';
}
}
?>
Search WWH ::




Custom Search