Beispiel #1
0
 public function getText($params, \Nette\Application\UI\Presenter $presenter, $default_text = null)
 {
     if (!isset($params[0])) {
         throw new \Exception("gettext macro must define 1 parameter {getText 'textName'}");
     }
     $name = $params[0];
     $default_text = htmlspecialchars_decode($default_text);
     $text = $this->textManager->getText($name);
     $texy = new \Texy\Texy();
     if (!$text) {
         $this->textManager->addText($name, $presenter->name . ':' . $presenter->getAction(), $default_text);
         return $texy->process($default_text);
     } else {
         return $texy->process($text->text);
     }
 }