Memcache, refactoring, View helpers, #16

git-svn-id: svn+ssh://code.netmonsters.ru/svn/majestic/branches/evo@124 4cb57b5f-5bbd-dd11-951b-001d605cbbc5
This commit is contained in:
pzinovkin
2010-03-13 23:33:46 +00:00
parent 4a22759e3d
commit 8fc917dca2
19 changed files with 706 additions and 147 deletions

View File

@ -32,6 +32,9 @@ class FrontController
private function __construct()
{
ErrorHandler::init();
if (DEBUG == true) {
Profiler::getInstance()->start();
}
$this->router = new Router();
}
@ -96,7 +99,6 @@ class FrontController
public function execute()
{
try {
$request = Env::getRequestUri();
$route = $this->getRouter()->route($request);
if (!$route) {
@ -107,14 +109,16 @@ class FrontController
if (!class_exists($action_class)) {
throw new GeneralException('Action class "' . $action_class . '" not found.');
}
$action = new $action_class();
$layout_class = $route->getLayout();
if (!class_exists($layout_class)) {
throw new GeneralException('Layout class "' . $layout_class . '" not found.');
}
$layout = new $layout_class();
return $layout->fetch($action);
$layout = new $layout_class();
$html = $layout->fetch($action);
return (!DEBUG) ? $html : Profiler::getInstance()->end($html);
} catch(Exception $e) {
if (DEBUG == true) {
return ErrorHandler::showDebug($e);