![]() |
Template Engine
Last week I started working Smarty Engine.I came to know that it is almost a language.It has its own loops,functions and etc.
Do I really need to learn Smarty `? |
Quote:
Some people are saying what's the point? especially if you are using a framework... As frameworks get better with their MVC, template engines like Smarty are going to be obsolete... I was going to really get into Smarty but decided not to. I have enough things on my plate. I am going to concentrate on PHP and the Zend Framework... |
In simple terms, if your project is going to include many a designer who is not apt at basic PHP then it's best to use a templating engine unless you plan to do all the front end xhtml/css work as well
|
The gripe I have with Smarty and other such template engines is precisely what has been mentioned! Why should we learn another seemingly differently language? Why are they creating yet another language for us to use when we have so many already at our disposal?
In my personal opinion, PHP is most certainly more than capable of handling this type of thing. However, I use the other syntax for the conditionals. Which is the following: Code:
<?php if ($myVariable): ?>html4strict Code:
I don't see why people choose to use Smarty? Perhaps somebody could explain this to me. |
Quote:
Unfortunately for me I wear many "hats"... *!**!* |
Quote:
Yeah like I said, I have enough on my plate...so I would have to learn another language to work with PHP, a language of itself? that's like speaking to an interpreter only for him/her to interpret yet again!! Zebra!! I love that name!!! I think I am going to steal it. :-P This is what I use for changing TR colors... $row[color] ? "#e0e0e0" : "#EEEEEE"; |
Thanks for taking your time and replying me.
There wouldn't be any designer for my project.But I want a project with more than one Template.Do I still no need Smarty ? |
I wouldn't use smarty, nor learn it.
|
Tried it, didn't like it, thus I went ahead and made my own which takes on a hybrid of PHP and XML.
|
Use strict PHP as template engine:
PHP Code:
|
Quote:
It strikes me as redundant, personally. It's similar to my dislike of most frameworks, why use thirty pounds of product when one pound is what you need? I would say no, you don't need to learn Smarty unless you have an employer that orders you to. |
Quote:
That is an interesting way to use IF ELSE statement, I've never seen it done that way. Glad to see that it can be done in other ways without always using the "BRACKETS".... Quote:
I personally will go ahead and try to learn probably Zend Framework because what I am seeing out there are employers looking for individuals with experience in Zend/CakePHP...and Smarty for templating. I can't learn them all so I figured I'll roll the dice with Zend.....hopefully it pays off... |
Yep, I use PHP as my template engine too.
PHP Code:
|
Quote:
Well for it smarty makes code readable for designers. |
Quote:
|
Smarty provides more than just PHP, it has a number of functions that are useful for alternating colored tables and things of the sort. To do that with a straight PHP template system would require lots of custom work unless you want to put lots of PHP code in your template.
|
Quote:
|
Quote:
If the designer is not an idiot, then he will not understand the complexity and the "strict" syntax of PHP. What is the difference between the following structures for a designer? Smarty: PHP Code:
PHP Code:
PHP Code:
PHP Code:
PHP Code:
PHP Code:
|
haha, triumvirat,
Good examples. If one were just a pure designer, the syntax would look just the same. I don't know that many PURE designers. In fact, in my 10 years in this field, I've only met ONE guy that ever said he can design webpages via photoshop but not touch any code. Good luck getting a job telling someone that you are talented in web design but don't know any code.... I'm sure most employers are looking for someone that can code and work with the team.... |
triumvirat that was really nice example.I read about smarty in a book that it ease the job for designers.
I have read many tutorials in which the file_get_contents and preg_match_all are used for a custom Template engine. Should I also avoid using custom template engines ? Quote:
It is better to design in photoshop and then recode it with css. And CSS is really flexible for it. |
| All times are GMT. The time now is 11:55 PM. |
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0