Forum Moderators: coopster
Which being in the web application development game you should already know anyways. ;)
Smarty is great, but if your application is tiny, then it's far too much overhead...as any templating system would be. Using includes and a templating engine are really two different things.
to answer the OP
personally i have always gone for home made templates with include files, this works best for me as it is simple, i would add that i only make simple websites, so perhaps if you are looking to do complicated things then it could be different
Which being in the web application development game you should already know anyways.
well, maybe, but it's horses for courses.
actually i'd never heard of MVC and it hasn't held me back yet, although as i say i only develop my own simple sites, the busiest of which only gets 250k uniques a week, so i'm small scale
actually i'd never heard of MVC
Ruby on Rails? Django? Struts? CodeIgniter? CakePHP? All MVC frameworks. It's pretty much a staple of modern web application development. I'd suggest at least getting familiar with the concept. Of course there are always different ways to approach a problem, but MVC is too much of a standard design pattern that it's almost second nature for any serious developer. Especially when working with groups of developers. It's all about separation of logic, view and data. Unfortunately PHP is plagued by people that freely embed, hard-code everything and churn out spaghetti code making it a nightmare for the next developer who works on the system.
PHP actually has a lot of great implementations of MVC and it will really speed up your development time too.
[en.wikipedia.org...]
[en.wikipedia.org...]
Not singling anyone out on this post, but this is a rudimentary concept. Especially if you are looking to put out production quality code that other developers and designers will use.
i looked at smarty once and it seemed to me there was a whole smarty syntax to learn - of course i could be totally mistaken.
Yes this is true, but you don't have to use the Smarty syntax. In fact you can create your own. For instance I can create my own tags that perform all logic behind the scenes and output data that designers can manipulate and 'decorate' using JS and CSS. Smarty also provides caching functionality that's a no-brainer to implement.
A good example is Textpattern, if you have ever used that. They have a complete tag/template engine. You can use Smarty to do the same thing.
If you have ever created a tag library for use in JSP pages, it's also similar.
But again, as everyone has stated...you just need to evaluate your needs. If you really need a template engine then don't shy away from learning Smarty or one of the others (there are lots for PHP). It'll benefit you down the road anyways.
Jokes aside, there is value in keeping your work as lean as possible. I have sites where I write a header.php and footer.php, sites where I write a template class, and other sites with a system that somewhat resembles MVC. Most of the time I go for the simplest approach that meets that projects needs. ::shrug::