Smarty集成到代码Igniter框架中 [英] Smarty integration into the Code Igniter framework

查看:133
本文介绍了Smarty集成到代码Igniter框架中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

一点背景信息

我最近一直在查看一些PHP框架,最终归结为两个。 Zend框架或CodeIgniter。



我喜欢CodeIgniter,因为它的设计简单。这是非常裸骨,它只是保持简单。我不喜欢的东西是弱模板系统。模板系统对我很重要,因为我将与另一个设计师工作。能够给他一个好的模板系统是一个很大的优势。



Zend是第二选择,因为更好的模板系统是内置的。Zend是一个不同的野兽虽然相比CodeIgniter。它强调模块之间的松耦合,但是是一个更大的框架。我不喜欢觉得我有很多事情运行在罩下,我从来没有使用。这是在我看来不必要的开销,所以我想到了一个模板系统到CodeIgniter:Smarty。



问题: / hard是将Smarty集成到CodeIgniter的过程?从我对CodeIgniter文档的初始扫描,我可以看到框架的布局很容易理解,我预计没有问题。我想知道,如果有人使用它之前,因此,我知道你经历过的任何陷阱,这将使这更难,应该是或不可能拉断。我也想知道这是否是一件好事。 CodeIgniter中的模板系统是否足够正常使用?除了Smarty之外,有没有其他模板模块对CodeIgniter有好处?我最好与Zend Framework?这里有发明的轮子吗?谢谢你的帮助!

解决方案

很抱歉,复活了一个旧问题,但没有任何答案已被标记为

有一个称为模板的库,可以让你使用任何你想要的模板解析器:



模板CI库 - 解析器



语法很容易集成到CI应用程序和smarty集成点。


A Little Background Information:
I've been looking at a few PHP framework recently, and it came down to two. The Zend Framework or CodeIgniter.

I prefer CodeIgniter, because of its simple design. It's very bare bone, and it is just kept simple. The thing I don't like though is the weak template system. The template system is important for me, because I will be working with another designer. Being able to give him a good template system is a big plus.

Zend was the second choice, because of the better template system that is built in. Zend is a different beast though compared to CodeIgniter. It emphasis "loose coupling between modules", but is a bigger framework. I don't like to feel like I have many things running under the hood that I never use. That is unnecessary overhead in my opinion, so I thought about putting a template system into CodeIgniter: Smarty.

Question(s): How easy/hard is the process to integrate Smarty into CodeIgniter? From my initial scan of the CodeIgniter documentation, I can see that the layout of the framework is easy enough to understand, and I anticipate no problems. I want to know if anyone has used it before, and therefore are aware of any "gotchas" you my have experienced that is going to make this harder than it should be or impossible to pull off. I also want to know if this is a good thing to do at all. Is the template system in CodeIgniter enough for normal use? Are there any other template modules that are good for CodeIgniter aside from Smarty? I better off with Zend Framework? Is any wheel being invented here? Thank you for your help!

解决方案

Sorry to resurrect an old question - but none of the answers have been flagged as "accepted" yet.

There's a library called "template" that does a great job of allowing you to use just about any template parser you want:

Template CI Library - Parsers

The syntax is pretty easy for integrating into your CI application and the smarty integration spot on.

这篇关于Smarty集成到代码Igniter框架中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆