Guest User

Untitled

a guest
Jan 17th, 2019
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.73 KB | None | 0 0
  1.     /**
  2.      * create template
  3.      *
  4.      * @param string $class|NULL
  5.      */
  6.     protected function createTemplate($class = NULL)
  7.     {
  8.         // inicializace
  9.         $texy = new Texy();
  10.         $texy->encoding = 'utf-8';
  11.         $texy->allowedTags = Texy::ALL;
  12.         $texy->allowedStyles = Texy::ALL;
  13.         $texy->setOutputMode(Texy::HTML5);
  14.  
  15.         // registrace filtru
  16.         $template = parent::createTemplate($class);
  17.         $template->registerHelper('texy', callback($texy, 'process'));
  18.         $template->registerHelper('timeAgoInWords', 'CIS\Templates\Helpers::timeAgoInWords');
  19.         $template->setTranslator($this->translator);
  20.        
  21.         $template->lang = $this->getLang();
  22.         $template->parameters = $this->parameters;
  23.  
  24.         return $template;
  25.     }
Add Comment
Please, Sign In to add comment