Archived
1
0
Fork 0

Moving about page to a PageController for static pages.

This commit is contained in:
Henrik Hautakoski 2015-02-21 14:53:23 +01:00
parent b873ab29c8
commit 9a68a04790
6 changed files with 24 additions and 19 deletions

View file

@ -124,7 +124,7 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
// Set global lang param
$router->setGlobalParam('lang', 'sv');
// Default route to default module
$router->addRoute('default', new Zend_Controller_Router_Route(':lang/:controller/:action/*',
array(
@ -132,19 +132,17 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
'controller' => 'index',
'action' => 'index'
)));
// Allow "direct access" to index controller in default module
$router->addRoute('default-default', new Zend_Controller_Router_Route(':lang/:action/*',
$router->addRoute('static-page', new Zend_Controller_Router_Route(':lang/:page/*',
array(
'module' => 'default',
'controller' => 'index',
'action' => 'index'
'controller' => 'page',
'action' => 'index',
),
array(
'action' => '(about)'
'page' => '(about)'
)));
// Routes for blog module
$router->addRoute('blog',new Zend_Controller_Router_Route(':lang/blog/:controller/:action/*',array(
'module' => 'blog',

View file

@ -3,7 +3,7 @@
<navigation>
<start>
<label>u:home</label>
<route>default-default</route>
<route>default</route>
<module>default</module>
<controller>index</controller>
</start>
@ -64,12 +64,12 @@
<about>
<label>uw:about</label>
<route>default-default</route>
<route>static-page</route>
<module>default</module>
<controller>index</controller>
<action>about</action>
<controller>page</controller>
<action>index</action>
<params>
<part>aboutf</part>
<page>about</page>
</params>
</about>
</navigation>

View file

@ -5,8 +5,4 @@ class IndexController extends Fiktiv_Controller_Action
public function indexAction()
{
}
public function aboutAction()
{
}
}

View file

@ -0,0 +1,11 @@
<?php
class PageController extends Zend_Controller_Action
{
public function indexAction()
{
$page = $this->_getParam('page', 'index');
$this->render($page);
}
}

View file

@ -38,8 +38,8 @@
</span>
<span class="float-right">
<a href="<?=$this->url(array('action' => 'about'),'default-default') ?>#cookies"><?=$this->translate('u:cookies')?></a> -
<a href="<?=$this->url(array('action' => 'about'),'default-default') ?>#about"><?=$this->translate('uw:about')?></a>
<a href="<?=$this->url(array('page' => 'about'), 'static-page') ?>#cookies"><?=$this->translate('u:cookies')?></a> -
<a href="<?=$this->url(array('page' => 'about'), 'static-page') ?>#about"><?=$this->translate('uw:about')?></a>
</span>
</div>
</div>