I'm pretty new to Zend (read the documents concerning routers and controllers).
My StaticController
and IndexController
:
class StaticController extends Zend_Controller_Action
{
public function displayAction()
{
$page = $this->getRequest()->getParam('filename');
$this->render($page);
}
}
class IndexController extends Zend_Controller_Action
{
public function indexAction()
{
$albums = new Application_Model_DbTable_Albums();
$this->view->albums = $albums->fetchAll();
}
public function registerAction()
{
...
}
}
application.ini :
resources.router.routes.staticpage.route = /:filename
resources.router.routes.staticpage.defaults.controller = static
resources.router.routes.staticpage.defaults.action = display
My static content urls are : site.com/faq
site.com/privacy
...
These work, however others, such as site.com/register
uses the StaticController
rather than the IndexController
, I can't say that I suprised by this behavior.
These static pages (about us, terms and cond...) need to be included in the zend logic for .po
translation.
I can think of many diffrent ways to achieve this outside the Zend framework, but would really like to do it the proper zend way.
How can I distinguish static and dynamic content, and still keep pretty urls?
Any help would be much appreciated !