Smarty集成到CodeIgniter框架中 [英] Smarty integration into the CodeIgniter framework

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

问题描述

一点背景信息

我最近一直在研究几个PHP框架,现在归结为两个。 Zend框架或CodeIgniter。

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.

我更喜欢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是第二选择,因为它内置了更好的模板系统。Zend与众不同虽然与CodeIgniter比较。它强调模块之间的松耦合,但它是一个更大的框架。我不想感到有很多事情在我从未使用过的引擎盖下运行。我认为这是不必要的开销,所以我考虑将模板系统放入CodeIgniter:Smarty。

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.

问题:多么容易/ hard是将Smarty集成到CodeIgniter的过程?从对CodeIgniter文档的初步扫描中,我可以看到框架的布局很容易理解,并且我预计不会出现任何问题。我想知道以前是否有人使用过它,因此知道您遇到的任何陷阱都会使它变得比实现或不应实现的难度更大。我也想知道这是否是一件好事。 CodeIgniter中的模板系统是否足以正常使用?除了Smarty之外,还有其他适用于CodeIgniter的模板模块吗?我最好使用Zend Framework吗?

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?

推荐答案

很抱歉,要复活一个老问题-但没有一个答案被标记为已接受

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:

模板CI库-V1.4.1

语法很容易集成到CI应用程序中,也很容易集成。

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

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

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