<?php /** * Grid of pages * * @author Anton Shevchuk * @created 27.08.12 10:08 */ namespace Application; use Bluz\Proxy\Layout; return function ($categoryID = null) use($view, $module, $controller) { /** * @var Bootstrap $this * @var \Bluz\View\View $view */ Layout::setTemplate('dashboard.phtml'); Layout::headStyle($view->baseUrl('jquery.fileupload/css/jquery.fileupload.css')); Layout::breadCrumbs([$view->ahref('Dashboard', ['dashboard', 'index']), __('Menu')]); $grid = new Menu\Grid(); $grid->setModule($module); $grid->setController($controller); $view->grid = $grid; $categoriesTable = Categories\Table::getInstance(); $foodTree = $categoriesTable->buildTreeByAlias('food'); $view->categories = reset($foodTree); };
*/ /** * @namespace */ namespace Application; use Application\Categories; use Bluz\Proxy\Layout; use Bluz\Proxy\Messages; return function ($id = null) use($view) { /** * @var Bootstrap $this * @var \Bluz\View\View $view */ Layout::setTemplate('dashboard.phtml'); Layout::headStyle($view->baseUrl('css/categories.css')); Layout::breadCrumbs([$view->ahref('Dashboard', ['dashboard', 'grid']), __('Categories')]); $categoriesTable = Categories\Table::getInstance(); $rootTree = $categoriesTable->getAllRootCategory(); if (count($rootTree) == 0) { Messages::addNotice('There are no categories'); return $view; } $view->rootTree = $rootTree; if (!$id) { $id = $rootTree[0]->id; } $view->branch = $id; $view->tree = $categoriesTable->buildTree($id); return $view; };
<?php /** * Bluz Framework Component * * @copyright Bluz PHP Team * @link https://github.com/bluzphp/framework */ /** * @namespace */ namespace Bluz\View\Helper; use Bluz\Application\Application; use Bluz\Proxy\Layout; return function ($style = null, $media = 'all') { /** * @var Layout $this */ if (Application::getInstance()->hasLayout()) { return Layout::headStyle($style, $media); } else { // it's just alias to style() call return $this->style($style); } };