Installation smarty Template Engine to local?

The template should not include the index.php file.

thanks!

please answer the question top.

if i not include, to titel display <?= $title ?> and to body not something Then no error.

Woot! Someone else who thinks exactly the same way as me. Smarty is absolutely the worst piece of software on the planet to write code in. It barely qualifies as a framework. I seriously gave it a go once and simply gave up trying to develop anything in it. My productivity went through the floor and was mired in the details for at least a month on just one super-simple project. As soon as I scrapped Smarty, I completely redid the whole project and finished it in about a week.

Literally ANYTHING is better than Smarty. Including hand-coding your own solution. That’s how bad it is.

This is perhaps a good reason to use something like smarty. When you have people who don’t know what they are doing touching your code somewhat retricting them is a good idea. At least smarty provides a level of separation that people who don’t know what they are doing can’t completely f**k up your work.

Smarty isn’t a framework, its a template engine. A framework is something like Symphony, CakePHP, Rails, modX, etc. Smarty is merely a template engine, that can be used as a component of a framework, like any other template engine.

I myself prefer PHP though. I use something similar to what Micheal Morris suggested. The template gets loaded with variables, they then get extracted into a method namespace where the template file is included as has access to all those variables. Nothing functionally stops me from running controller logic or issuing a query wthin my template. That is just something you need to learn, and adhere to as far as MVC is concerned.

@oddz - Hmm…I didn’t say the first quote (seems like mohrt said it). Weird.

Thank you very much all friends
Discussion you is beautiful about SMARTY and template engine. i find a learn for mvc and work to it.

  1. what your standpoint about use mvc-PHPRO?
    link: http://www.phpro.org/tutorials/Model-View-Controller-MVC.html
  2. did mvc is a template engine or framework?
  3. How much is impressible mvc to speed website?

Yeah, your right that was, mohrt. Sorry about messing that up.

There are plenty of cases with just the opposite experience as thruska. Easy to implement, and saves a ton of cycles maintaining templates.

If you have a project with non-coders maintaining templates, that is where Smarty shines. Many will also use it on projects simply because they prefer the syntax over PHP. On a small project where one developer maintains everything is a use-case that is commonly not a good fit for Smarty.

The best approach is to understand Smarty and make an informed decision for yourself. Don’t rely on opinions and assumptions. This is a decent introduction: