示例#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
文件: Grid.php 项目: v6ak/Gridito
 /**
  * Create template
  * @return Template
  */
 protected function createTemplate()
 {
     return parent::createTemplate()->setFile(__DIR__ . "/templates/grid.phtml");
 }
示例#4
0
文件: Column.php 项目: v6ak/Gridito
 /**
  * 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;
 }