added index redirect plugin

This commit is contained in:
Logsol 2013-07-08 23:56:50 +02:00
parent 0c80e23e72
commit f6572151ec
3 changed files with 14 additions and 2 deletions

View file

@ -27,8 +27,7 @@ class IndexController extends Katharsis_Controller_Abstract
*/
public function indexAction()
{
$controller = new PageController();
$controller->homeAction();
// will be overwritten by IndexRedirect Plugin
}
/**

View file

@ -0,0 +1,12 @@
<?php
class Local_Controller_Plugin_IndexRedirect extends Katharsis_Controller_Plugin_Abstract
{
public function preController()
{
if(Katharsis_Request::getControllerName() == 'index' && Katharsis_Request::getActionName() == 'index')
{
Katharsis_Request::setControllerName('page');
Katharsis_Request::setActionName('home');
}
}
}

View file

@ -16,6 +16,7 @@ Katharsis_Autoload::init();
//Katharsis_Controller_Plugin::registerPlugin(new DidgeridooArtwork_Controller_Plugin_SetNames());
Katharsis_Controller_Plugin::registerPlugin(new Katharsis_Controller_Plugin_StartSession());
Katharsis_Controller_Plugin::registerPlugin(new DidgeridooArtwork_Controller_Plugin_Notice());
Katharsis_Controller_Plugin::registerPlugin(new Local_Controller_Plugin_IndexRedirect());
Katharsis_Controller_Plugin::registerPlugin(new Katharsis_Controller_Plugin_Autorender());
Katharsis_Controller_Plugin::registerPlugin(new DidgeridooArtwork_Controller_Plugin_Access());