Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the difference between Smarty and Zend?

I came upon Smarty which is a template engine. But there are also the Zend, CakePHP frameworks. Is Smarty like Zend, or are they completely different? Smarty just separates logic from display - is this similar to a framework like Zend?

like image 476
jpjp Avatar asked May 30 '10 20:05

jpjp


3 Answers

Smarty is a template engine while Zend is a complete php framework.

Smarty

Smarty is a web template system written in PHP. Smarty is primarily promoted as a tool for separation of concerns, which is a common design strategy for certain kinds of applications.[1][2]

Smarty generates web content by the placement of special Smarty tags within a document. These tags are processed and substituted with other code.

Tags are directives for Smarty that are enclosed by template delimiters. These directives can be variables, denoted by a dollar sign ($), functions, logical or loop statements. Smarty allows PHP programmers to define custom functions that can be accessed using Smarty tags.

Smarty is intended to simplify compartmentalization, allowing the presentation of a web page to change separately from the back-end. Ideally, this eases the costs and efforts associated with software maintenance. Under successful application of this development strategy, designers are shielded from the back-end coding, and PHP programmers are shielded from the presentation coding.

Zend

ZF is a use-at-will framework. There is no single development paradigm or pattern that all Zend Framework users must follow, although ZF does provide components for the MVC, Table Data Gateway, and Row Data Gateway design patterns. Zend Framework provides individual components for many other common requirements in web application development.[1]

Zend Framework also seeks to promote web development best practices in the PHP community; conventions are not as commonly used in ZF as in many other frameworks, rather suggestions are put forth by setting reasonable defaults that can be overridden for each ZF application’s specific requirements.[4]

like image 140
Sarfraz Avatar answered Oct 03 '22 20:10

Sarfraz


A template engine (Smarty) simply provides a method to separate the display from the actual code.

A framework (Zend, CakePHP, Drupal etc) provides essentially a language extension on top of PHP. You then use this 'language' to write your site. It provides you with methods to achieve more complex tasks easily (more so at least). It generally helps with things such as database access, security, i18n/l10n, caching, templating, etc.

like image 25
Dan McGrath Avatar answered Oct 03 '22 19:10

Dan McGrath


Zend is an open source web application framework.

Smarty is a web template system.

Check Zend and Smarty.

like image 26
Incognito Avatar answered Oct 03 '22 21:10

Incognito