parent
4870dc04b2
commit
9eeaabc6fe
364 changed files with 51722 additions and 987 deletions
|
|
@ -14,6 +14,7 @@ use b8\Exception\HttpException;
|
|||
use b8\Http\Response;
|
||||
use b8\Http\Response\RedirectResponse;
|
||||
use b8\View;
|
||||
use PHPCI\Model\Build;
|
||||
|
||||
/**
|
||||
* PHPCI Front Controller
|
||||
|
|
@ -91,18 +92,30 @@ class Application extends b8\Application
|
|||
$this->response->setContent($view->render());
|
||||
}
|
||||
|
||||
if (View::exists('layout') && $this->response->hasLayout()) {
|
||||
$view = new View('layout');
|
||||
$pageTitle = $this->config->get('page_title', null);
|
||||
if ($this->response->hasLayout()) {
|
||||
$this->setLayoutVariables($this->controller->layout);
|
||||
|
||||
if (!is_null($pageTitle)) {
|
||||
$view->title = $pageTitle;
|
||||
}
|
||||
|
||||
$view->content = $this->response->getContent();
|
||||
$this->response->setContent($view->render());
|
||||
$this->controller->layout->content = $this->response->getContent();
|
||||
$this->response->setContent($this->controller->layout->render());
|
||||
}
|
||||
|
||||
return $this->response;
|
||||
}
|
||||
|
||||
protected function loadController($class)
|
||||
{
|
||||
$controller = parent::loadController($class);
|
||||
$controller->layout = new View('layout');
|
||||
$controller->layout->title = 'PHPCI';
|
||||
$controller->layout->breadcrumb = array();
|
||||
|
||||
return $controller;
|
||||
}
|
||||
|
||||
protected function setLayoutVariables(View &$layout)
|
||||
{
|
||||
/** @var \PHPCI\Store\ProjectStore $projectStore */
|
||||
$projectStore = b8\Store\Factory::getStore('Project');
|
||||
$layout->projects = $projectStore->getAll();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue