/** * * @param string $snippet_name * @param array $vars * @return null|View_Front */ public static function get($snippet_name, $vars = NULL) { $snippet = new Model_File_Snippet($snippet_name); if (!$snippet->is_exists()) { if (($found_file = $snippet->find_file()) !== FALSE) { $snippet = new Model_File_Snippet($found_file); } else { return NULL; } } $view = View_Front::factory($snippet->get_file(), $vars); if (isset($view->page_object)) { $view->page = $view->page_object; } return $view; }
/** * * @param integer $page_id * @param string $part * @return View */ public static function get($page, $part) { $html = NULL; $page_id = $page instanceof Model_Page_Front ? $page->id() : (int) $page; self::_load_parts($page_id); if (empty(self::$_cache[$page_id][$part])) { return NULL; } if (self::$_cache[$page_id][$part] instanceof Model_Page_Part) { $html = View_Front::factory()->render_html(self::$_cache[$page_id][$part]->content_html); } else { if (self::$_cache[$page_id][$part] instanceof Kohana_View) { $html = self::$_cache[$page_id][$part]->render(); } } return $html; }
protected function _fetch_render() { $data = $this->fetch_data(); $data['params'] = $this->template_params; return View_Front::factory($this->template, $data)->bind('header', $this->header)->bind('widget', $this); }
?> </label> <div class="<?php echo Arr::get($form, 'input_container_class'); ?> "> <?php echo Form::textarea('meta_description', $document->meta_description, array('class' => 'form-control', 'rows' => 2)); ?> </div> </div> <hr class="panel-wide" /> </div> <?php if ($datasource->template() !== NULL) { echo View_Front::factory($datasource->template(), array('fields' => $fields)); } elseif (!empty($fields)) { ?> <div class="panel-body"> <?php foreach ($fields as $key => $field) { ?> <?php echo $field->backend_template($document); ?> <?php } ?> </div> <?php }
/** * * @return View_Front * @throws Kohana_Exception */ public function render_layout() { $layout = $this->get_layout_object(); return View_Front::factory($layout->get_file()); }