Nandini Bhaduri
Nandini Bhaduri

Reputation: 1865

Zend_Layout and/or Smarty

I am new to Zend Framework, but planning to create quite a complex project using it.

I was looking at the view options for Zend Framework. There is one with Zend_View and Zend_Layout and also template engines like Smarty can be integrated with it.

Now I would like to know, do they serve the same purpose? Like I can either use Zend_Layout or Smarty or is it better to use both?

Upvotes: 3

Views: 358

Answers (2)

bkilinc
bkilinc

Reputation: 989

I have seen lots of benefits of using smarty for nearly 10 years. First of all, smarty restricts template designers to use small set of functions which are related to view only. This will make easier to manage template files and will create a layer of security. Using PHP on view layer allows quick solutions with PHP and can create great mess. Smarty is compiled and there is nearly no performance loss. Syntax is more concise than PHP views. With Smarty 3 "template inheritance" features saved lots of time, which cannot be easily implemented with PHP classes.

Upvotes: 0

JohnP
JohnP

Reputation: 50039

I've worked on two large scale Zend projects. We don't use a separate layout engine, we just use the built in Zend_View.

Layering Smarty on top of Zend wouldn't serve much purpose (imo, would like to see some alternative experiences though)

Upvotes: 4

Related Questions