initial commit
This commit is contained in:
commit
f2ff442d8a
21 changed files with 1559 additions and 0 deletions
31
library/Katharsis/Controller/Plugin/Abstract.php
Normal file
31
library/Katharsis/Controller/Plugin/Abstract.php
Normal 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()
|
||||
{
|
||||
}
|
||||
}
|
32
library/Katharsis/Controller/Plugin/Autorender.php
Normal file
32
library/Katharsis/Controller/Plugin/Autorender.php
Normal 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');
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue