initial commit

This commit is contained in:
logsol 2011-04-08 03:27:38 +12:00
commit f2ff442d8a
21 changed files with 1559 additions and 0 deletions

View file

@ -0,0 +1,31 @@
<?php
/**
* Abstract Controller Plugin
* All controller plugins must extend this class.
*
* @author Karl Pannek <info@katharsis.in>
* @version 0.5.2
* @package Katharsis
*/
abstract class Katharsis_Controller_Plugin_Abstract
{
/**
* Overwrite this method, if you want something to be processed
* _before_ the controller is called
*
* @return void
*/
public function preController()
{
}
/**
* Overwrite this method, if you want something to be processed
* _after_ the controller was called
*
* @return void
*/
public function postController()
{
}
}

View file

@ -0,0 +1,32 @@
<?php
/**
* Autorender Controller Plugin
*
* @author Karl Pannek <info@katharsis.in>
* @version 0.5.2
* @package Katharsis
*/
class Katharsis_Controller_Plugin_Autorender extends Katharsis_Controller_Plugin_Abstract
{
/**
* Renders a controller/action.phtml template automaticly after processing controller
*
* @return void
*/
public function postController()
{
$view = Katharsis_View::getInstance();
$view->controllerAction = false;
$templateName = strtolower(Katharsis_Request::getControllerName()) . DIRECTORY_SEPARATOR . strtolower(Katharsis_Request::getActionName());
if(file_exists('application/view' . DIRECTORY_SEPARATOR . $templateName . '.phtml'))
{
$view->controllerAction = $templateName;
}
$view = Katharsis_View::getInstance();
echo $view->render('main');
}
}