On the net to see is the front and back end of the separation, easy to set data, but I feel is smarty syntax is more complex, no PHP basic syntax is simple, feel direct to write PHP is simpler, do not know what the role of using Smarty?
Reply content:
On the net to see is the front and back end of the separation, easy to set data, but I feel is smarty syntax is more complex, no PHP basic syntax is simple, feel direct to write PHP is simpler, do not know what the role of using Smarty?
If you are studying, you can use it, but few people use it in actual production.
There are a lot of good PHP frameworks, such as Laravel, CodeIgniter, Yii, etc., you can learn these.
Useful!!!!
The finished code looks better ...
Smarty All of these templates are theoretically easy to develop and safe to filter, but the program requires additional parsing and compilation, which is more efficient than native PHP nesting
The function of the template is to separate the front and back end, recommend twig template instead of smarty. If you are very concerned about performance, you can also use the ob_** () function to do a simple template function.