I got two days of ECShop and got in touch with some smarty templates. I didn't learn smarty, but I used it in ECShop. I don't know. Is there any need to learn smarty for the current trend ?? I got two days of ECShop and got in touch with some smarty templates. I didn't learn smarty, but I used it in ECShop. I don't know. Is there any need to learn smarty for the current trend ??
Reply content:
I got two days of ECShop and got in touch with some smarty templates. I didn't learn smarty, but I used it in ECShop. I don't know. Is there any need to learn smarty for the current trend ??
If the project code needs to be used at work, you can simply look at other code without looking at the document;
Other situations?Complete! All! No! Yes! Yes! Go! Learn! Xi!
1. PHP itself is the best template language;
2. Try to learn about Angular Or React and you will find that you do not want to see any PHP code in the template;
If you need it, you must learn it! Moreover, it is not difficult to learn the template engine.
If you just look at the trend of the PHP template engine, you can take a look at Twig, the best overall level of PHP template engine!
Learning refersResearch source code
OrLearn to use
?
Research is acceptable. If you use it, you just need to learn how to use it when necessary. So many technologies cannot be learned in advance.
Is smarty the first template in your life? It is my first one. When thinkPHP and laravel are used, you will find a better template for you to choose from. You will find a template suitable for you, and you will find that most of the original templates are similar, it takes a few minutes to learn about the general syntax specification. In this way, there is no need to learn templates for a specific template. It should be selected based on your current production environment. Of course, the template language in nodejs is similar.
We do not advocate it. Now we generally adopt the frontend and backend separation method, but the development background template engine is still relatively fast.
Try the python flask framework, which is concise and abnormal.
If it is a work requirement, you must be familiar with it. Currently, the maintenance system is based on SMARTY.
Of course there are still many template engines, such as twig and vuejs used by the company, and React.
Learning, but not necessary
However, learning is another thing.
You can learn the idea of this development mode and compare it with other development modes that you are in contact with to improve yourself.
There is no need. PHP itself is a very good template engine. Why should we encapsulate it once? Some people say that in order to make the previous paragraph look more comfortable. I would like to say that the front-end is more comfortable, but they still want to learn a language for the template engine. however, if you have learned the native PHP template engine. then you can use this one later. there are so many things.
In general, it is best to use the original sound.
No.
Agreeing to the above statement proves that writing templates directly with PHP is the best practice.
Let's take a look at the principles of the template and use it with the API.
There is no need to learn about it. Currently, there are not many frameworks that have their own templates. The template principles are similar. when you need them, you can understand how templates render data, how to use the template if else and foreach is usually enough.
After ten years of programming, I only used smarty in ecshop, so I don't think it is necessary to learn it unless the architecture you are using already contains it. Php is actually a template language that can be mixed with HTML, so the PHP template engine has always been a little chicken.
After the meeting, I will learn other things and I will have a concept. This template is suitable for beginners. I also learned this from the beginning. Later I learned the framework and all the frameworks have their own templates, the usage is simpler than this. For example, the template in laravel is a very simple syntax. Similar to smarty in thinkphp, it seems that smarty is used.
If you want to use a PHP template, Twig is preferred, which is already recommended. Upstairs, thinkPHP has always been its own template engine and never used smarty
As the most widely used php template engine, smarty has a complete set of functions that support various complex scenarios. Due to its long history, the Code seems a little complex, and many template engines have emerged, such as think, twig, blade, etc. For beginners, learning smarty is nothing bad.