【问题标题】:Create template in CodeIgniter在 CodeIgniter 中创建模板
【发布时间】:2013-09-07 11:10:33
【问题描述】:

Kohana 在网站控制器中创建模板时,我们定义模板路径,如

public $template = 'user/template';

在 Code Igniter 中,我们如何定义这个模板。

我需要建议。

【问题讨论】:

  • 我不得不提到公共 $template 变量。我需要默认模板。
  • @mangala:在控制器的加载视图中。代码 sn-p: $this->load->view('default', $data_array); 它将加载名为 default.php 的视图。
  • 所以我必须调用这个 $this->load->view('default', $data_array);一个动作,对吧?
  • 请看我的回答stackoverflow.com/a/18231097/1613335 类似的问题

标签: php codeigniter templates kohana


【解决方案1】:

您需要使用 Parser 类(Codeigniter 内置)

http://ellislab.com/codeigniter%20/user-guide/libraries/parser.html

按照上面链接上的指南应该可以解决您的问题:P

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2013-05-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-19
    • 1970-01-01
    • 2013-04-24
    相关资源
    最近更新 更多