CodeIgniter模块化CMS与模板

时间:2012-03-12 15:52:17

标签: templates codeigniter content-management-system modular

你们大概都想到“哦,我的上帝另一个想要创建CMS的人”, 但我真的需要你的帮助! 我想用模块和模板创建一个自己的CMS。 我已经安装了Modular Extensions,但现在我正在努力使用模板。 我只是不知道如何构建它。

我知道模板库Smarty和Phil的那个。

你们可以帮助我一些如何创建这个,我想建立像PyroCMS或Ionize这样的东西,但是然后在根目录中:application / system / templates 所以我可以在将来为我的CMS构建模板,并且我可以使用{cms.navigation}和{cms.page.title}等标签

我的结构

application
system
templates
 - css
 - img
 - js
 - header.php
 - home.php
 - footer.php

application/modules
- blog
 - controllers
 - models
 - views
 - blog_routes.php
- guestbook
- pages
- etc
- etc

1 个答案:

答案 0 :(得分:1)

我最近找到了CI的友好模板引擎。它适用于MVC或HMVC。它肯定不像Wesley Murch在其他帖子中提到的那样有文献记载或受欢迎,但它的轻快。它可以通过Spark安装或不安装。有三种方法可以显示来自控制器的html ......

一种很好的使用方式:

$this->template->main_content = $this->load->view('dashboard/tables/faq_pages_list', $info_array, true);

在模板中:

echo $this->template->main_content;

如果您加载并使用CI的本机解析器,友好模板还允许您使用{花括号}。

https://github.com/segersjens/CodeIgniter-Template-Library