Code formatting

This commit is contained in:
Anton Terekhov
2011-10-13 14:55:06 +04:00
parent 642c5909aa
commit 3ebfac9db4
12 changed files with 92 additions and 86 deletions

View File

@ -15,20 +15,20 @@ class FrontController
* @var Router
*/
protected $router;
/**
* @var string
*/
protected $view = 'PHPView';
protected $base_url = '';
/**
* @var FrontController
*/
protected static $instance;
private function __construct()
{
ErrorHandler::init();
@ -37,7 +37,7 @@ class FrontController
}
$this->router = new Router();
}
/**
* Refuse cloning
*/
@ -53,7 +53,7 @@ class FrontController
}
return self::$instance;
}
/**
* @param string $view
* @return FrontController
@ -63,9 +63,9 @@ class FrontController
$this->view = $view;
return $this;
}
/**
*
*
* @return iView
*/
public function getView($view = null)
@ -73,7 +73,7 @@ class FrontController
$view = ($view) ? $view : $this->view;
return new $view(Config::get($view));
}
/**
* @param string $url
*/
@ -82,12 +82,12 @@ class FrontController
$this->base_url = rtrim($url, '/');
return $this;
}
public function getBaseUrl()
{
return $this->base_url;
}
/**
* @return Router
*/
@ -95,7 +95,7 @@ class FrontController
{
return $this->router;
}
public function execute()
{
try {
@ -104,18 +104,18 @@ class FrontController
if (!$route) {
throw new Error404Exception('Route for "' . $request . '" not found');
}
$action_class = $route->getAction();
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();
$html = $layout->fetch($action);
if (DEBUG) {