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

View file

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

View file

@ -5,8 +5,4 @@ class IndexController extends Fiktiv_Controller_Action
public function indexAction() 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>
<span class="float-right"> <span class="float-right">
<a href="<?=$this->url(array('action' => 'about'),'default-default') ?>#cookies"><?=$this->translate('u:cookies')?></a> - <a href="<?=$this->url(array('page' => 'about'), 'static-page') ?>#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') ?>#about"><?=$this->translate('uw:about')?></a>
</span> </span>
</div> </div>
</div> </div>