Пример #1
0
 /**
  * znova spracovava retazec s latte syntaxou s vyuzitim StringTemplate
  *
  * @param string $s
  * @return string
  */
 public static function latte($s)
 {
     // kedze HTML Purifier aj CKEditor escape-uju entity, tak by mi nefungovali nette linky -> robim replace
     $search = array('->', '=>');
     $replace = array('->', '=>');
     $s = str_replace($search, $replace, $s);
     $tpl = new StringTemplate();
     $tpl->presenter = Environment::getApplication()->getPresenter();
     // nutné např. pro rozchození linků
     $tpl->registerFilter(new LatteFilter());
     $tpl->content = $s;
     // obsah šablony (řetězec)
     $tpl->control = $tpl->presenter;
     // vrátíme vygenerovanou šablonu
     return $tpl->__toString();
     // nebo ji vypíšeme na výstup
     //		$tpl->render();
 }
Пример #2
0
 {
     $menu = new Menu();
     $menu->setTranslator(new Translator($this->lang));
     return $menu;
 }
 public function createComponentSearchBox()
 {
     $box = new SearchForm();
     return $box;