Пример #1
0
 /**
  * @return \Nette\Templates\FileTemplate
  */
 protected function createTemplate()
 {
     $template = parent::createTemplate();
     $template->setFile($this->getTemplateFilePath());
     $template->registerHelperLoader(array($this->getService("TemplateHelperLoader"), "getHelper"));
     return $template;
 }
Пример #2
0
 /**
  * Starts conditional snippet rendering. Returns SnippetHelper object if snippet was started.
  * @param  Control control
  * @param  string  snippet name
  * @param  string  start element
  * @return SnippetHelper
  */
 public static function create(Nette\Application\Control $control, $name = NULL, $tag = 'div')
 {
     if (self::$outputAllowed) {
         // rendering flow or non-AJAX request
         $obj = new self();
         $obj->tag = trim($tag, '<>');
         if ($obj->tag) {
             echo '<', $obj->tag, ' id="', $control->getSnippetId($name), '">';
         }
         return $obj;
         // or string?
     } elseif ($control->isControlInvalid($name)) {
         // start snippet buffering
         $obj = new self();
         $obj->id = $control->getSnippetId($name);
         $obj->payload = $control->getPresenter()->getPayload();
         ob_start();
         $obj->level = ob_get_level();
         self::$outputAllowed = TRUE;
         return $obj;
     } else {
         return FALSE;
     }
 }
Пример #3
0
 /**
  * Create template
  * @return Template
  */
 protected function createTemplate()
 {
     return parent::createTemplate()->setFile(__DIR__ . "/templates/grid.phtml");
 }
Пример #4
0
 /**
  * Load state
  * @param array $params
  */
 public function loadState(array $params)
 {
     parent::loadState($params);
     $this->loadSorting();
 }
Пример #5
0
 /**
  * Loads state informations.
  * @param  array
  * @return void
  */
 public function loadState(array $params)
 {
     parent::loadState($params);
     $this->getPaginator()->page = $this->page;
 }