What is Smarty?
Smarty is a template engine for PHP. More specifically, it facilitates a manageable way to separate application logic and content from its presentation. This is best described in a situation where the application programmer and the template designer play different roles, or in most cases they are not the same person.
Using Smarty with the Zend Framework
Every Enterprise 2.0 strategy should include a plan for the base code. Our base code should easily support our Web 2.0 needs on our Enterprise 2.0 platform. The Model View Controller structure of the Zend Framework automatically supports a built-in template system. The Framework is flexible enough to plug-in your custom template system or existing systems. Smarty is a very well documented and supported system. The strategy of using Smarty with Zend will provide a solid foundation for our Enterprise 2.0 platform. This is what we define as Strategy 2.0, leveraging the effort of crowds. Thanks to all the dedicated developers at Smarty for keeping our costs down and making our lives easier.
Connecting to Your Server
Connect to your server with a command line tool like PuTTY
PuTTY is a free implementation of Telnet and SSH for Win32 and Unix platforms, along with an xterm terminal emulator. It is written and maintained primarily by Simon Tatham.
These steps are executed by super user (su) in your site’s root directory
- wget http://www.smarty.net/do_download.php?download_file=Smarty-2.6.20.tar.gz (Note: Check http://www.smarty.net for the latest version.)
- tar – zxf Smarty-2.6.20.tar.gz
- rm Smarty-2.6.20.tar.gz
- mv Smarty-2.6.20/libs /usr/local/lib/php/Smarty
- rm -rf Smarty-2.6.20
Install Steps Explained
- Get file package from site.wget http://www.smarty.net/do_download.php?download_file=Smarty-2.6.20.tar.gz (Note: Check http://www.smarty.net for the latest version.)
- Decompress the file.tar – zxf Smarty-2.6.20.tar.gz
- Delete the compressed file.rm Smarty-2.6.20.tar.gz
- Move the library files to your standard location.
Note: This is usually something like “/usr/local/lib/php”, but you may need to check your PHP Include Path to validate your standard location.mv Smarty-2.6.20/libs /usr/local/lib/php/Smarty
- Delete the decompressed directory and all it’s contents.rm -rf Smarty-2.6.20