Exemplo n.º 1
0
 public function before()
 {
     parent::before();
     $this->_ctx = Context::instance();
     $this->_ctx->request($this->request)->response($this->response);
     View_Front::bind_global('ctx', $this->_ctx);
 }
Exemplo n.º 2
0
 /**
  * 
  * @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;
 }
Exemplo n.º 3
0
 /**
  * 
  * @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;
 }
Exemplo n.º 4
0
 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);
 }
Exemplo n.º 5
0
?>
</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 
}
Exemplo n.º 6
0
 /**
  * 
  * @param string $html
  * @return string
  */
 public function render_html($html)
 {
     // Combine local and global data and capture the output
     return View_Front::capture_html($html, $this->_data);
 }
Exemplo n.º 7
0
 /**
  * 
  * @return View_Front
  * @throws Kohana_Exception
  */
 public function render_layout()
 {
     $layout = $this->get_layout_object();
     return View_Front::factory($layout->get_file());
 }