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?
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]
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.
Zend is an open source web application framework.
Smarty is a web template system.
Check Zend and Smarty.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With