Передача параметров в layout и вывод количества точек в заголовке окна

This commit is contained in:
Krivchikov Dmitry 2014-04-16 10:37:20 +04:00
parent c6c7e3ceec
commit 271115577a
2 changed files with 4 additions and 0 deletions

View File

@ -72,6 +72,7 @@ abstract class Controller
'content' => $content, 'content' => $content,
'styles' => self::$styles, 'styles' => self::$styles,
'scripts' => self::$scripts, 'scripts' => self::$scripts,
'data' => $data,
), true); ), true);
if ($return) if ($return)

View File

@ -18,6 +18,9 @@ class IndexController extends Controller
$category = new Category(); $category = new Category();
$res = App::$DB->query("SELECT COUNT(`id`) pointsCount FROM `points`")->fetch(PDO::FETCH_ASSOC);
App::setConfig('title', App::getConfig('title').' ('.$res['pointsCount'].' и даже больше поводов не сидеть дома)');
self::render('indexTemplate.php', array( self::render('indexTemplate.php', array(
'categories' => $category->getAll('', 'ord'), 'categories' => $category->getAll('', 'ord'),
)); ));