protected function extendTwig() { parent::extendTwig(); $formatDateFilter = new \Twig_SimpleFilter('formatDate', function (\DateTime $date) { return $date->format('n-j-Y'); }); $this->twig->addFilter($formatDateFilter); }
protected function addVariables() { parent::addVariables(); $groupModelTypes = (new \Stack\Setting())->parse('BackOffice')->get('model'); foreach ($groupModelTypes as $group => $modelTypes) { if (!is_array($modelTypes)) { if (empty($modelTypes)) { unset($groupModelTypes[$group]); } else { \UArray::doRenameKey($groupModelTypes, $group, $modelTypes); $groupModelTypes[$modelTypes] = [$modelTypes]; } } } $this['groupModelTypes'] = $groupModelTypes; }
protected function addVariables() { parent::addVariables(); $this['currentUser'] = \Staq::Ctrl('Auth')->currentUser(); }