What is smarty?
Moderator: General Moderators
What is smarty?
I would like to know what smarty is and what it is used for.
Here is a pretty good source: http://smarty.php.net/.
Smarty is a template engine. The primary purpose is to allow you to separate presentation logic from appliction logic.
See also http://www.phpwact.org/pattern/template_view
See also http://www.phpwact.org/pattern/template_view
In simple terms it would allow you to create template variables that get inserted into template files. Something like:
Which many perfer over:
That's a real simlified explanation....
See the smarty site for more details....
Code: Select all
<p>{$content}</p>Code: Select all
<?php echo $content ?>See the smarty site for more details....
But be careful, since smarty provides strong template functionality!
For example, if you have some if conditions and/or nested loops in your template, it is not really designer friendly, even with smarty.
Smarty gives you only the possibility to seperate data logic from presentation logic. Thats a bit different from seperating pure, designer friendly HTML-Code from PHP-Code.
Just my two cents...
Regards
Jens
For example, if you have some if conditions and/or nested loops in your template, it is not really designer friendly, even with smarty.
Smarty gives you only the possibility to seperate data logic from presentation logic. Thats a bit different from seperating pure, designer friendly HTML-Code from PHP-Code.
Just my two cents...
Regards
Jens