Templates Kohana框架3.3中的模板
我使用的是Kohana框架,这实际上是我使用的第一个框架。我只是想知道如何在视图中正确添加模板。我现在正在做的是 在控制器中Templates Kohana框架3.3中的模板,templates,frameworks,kohana,Templates,Frameworks,Kohana,我使用的是Kohana框架,这实际上是我使用的第一个框架。我只是想知道如何在视图中正确添加模板。我现在正在做的是 在控制器中 <?php defined('SYSPATH') or die('No direct script access.'); class Controller_Welcome extends Controller_Template { public $template = 'site'; public function action_index()
<?php defined('SYSPATH') or die('No direct script access.');
class Controller_Welcome extends Controller_Template {
public $template = 'site';
public function action_index()
{
$this->template->header = View::factory('templates/header');
$this->template->header->title = 'Page name - Welcome';
$this->template->header->description = 'Blah blah blah.';
}
看看Kohana的插件。我想这是将布局与逻辑分离的最佳方法。看看Kohana的插件。我知道将布局与逻辑分离的最佳方法。看一看
它允许你做一些简单的事情,比如
<li>{{kostachevariable}}</li>
在模板文件中,您只需要
<head>
<title>{{mypagetitle}}</title>
{{mypagetitle}}
它还有很多其他的好功能。看看
它允许你做一些简单的事情,比如
<li>{{kostachevariable}}</li>
在模板文件中,您只需要
<head>
<title>{{mypagetitle}}</title>
{{mypagetitle}}
它还有很多其他的好功能