Ejemplo n.º 1
0
 protected function startup()
 {
     if (!$this->user->isInRole('admin')) {
         throw new ForbiddenRequestException();
     }
     parent::startup();
 }
Ejemplo n.º 2
0
 protected function createTemplate()
 {
     $template = parent::createTemplate();
     $template->registerHelper('texy', function ($text) {
         $texy = new \Texy();
         $texy->setOutputMode(\Texy::HTML4_TRANSITIONAL);
         $texy->encoding = 'utf-8';
         $texy->allowedTags = array('strong' => \Texy::NONE, 'b' => \Texy::NONE, 'a' => array('href'), 'em' => \Texy::NONE, 'p' => \Texy::NONE);
         //$texy->allowedTags = \Texy::NONE;
         return $texy->process($text);
     });
     return $template;
 }