2

I have spoke to many people working in PHP.When ever I say to them I am working in smarty framework they tell me its a template system.But I know smarty uses MVC pattern to create and maintain web sites.

Is PHP Smarty a Template Engine or Framework or Both?

Please Explain the same

5
  • Reference: MVC, template engine. Commented Dec 27, 2012 at 7:45
  • Thanks for reply charles I know what is MVC and what is template engine. I am particular about smarty Commented Dec 27, 2012 at 7:47
  • In programming , framework in general has no exact defination. It varies on situation. According to terminolgy we use in PHP , smarty is just a template engine , not a framework. CakePHP, zend , codeigniter.. yii etc are what we call frameworks. Commented Dec 27, 2012 at 7:48
  • 1
    See the relationship between Symfony and Twig. Smarty is a tool used by libraries and frameworks to manage what would be the view in MVC. Like Twig, though, it is not meant to be your library or framework. Some argue that Smarty is a template system that exposes far too much underlying PHP to be a purely template-focused tool like Flexy and Twig, where the designer is only given so much capability, when compared to Smarty. This is why you may see some developers avoid and disparage it's use in projects. In the right hands, it's ok. But be careful. Commented Dec 27, 2012 at 8:03
  • 1
    smarty.net in logo writes "Template Engine" ... Commented Dec 27, 2012 at 8:44

1 Answer 1

8

What is Smarty?

Smarty is a template engine for PHP, facilitating the separation of presentation (HTML/CSS) from application logic. This implies that PHP code is application logic, and is separated from the presentation.

What Smarty is Not

Smarty is not an application development framework. Smarty is not an MVC. Smarty is not an alternative to Zend Framework, CodeIgniter, CakePHP, or any of the other application development frameworks for PHP.

http://www.smarty.net/about_smarty

http://smarty.incutio.com/?page=SmartyFrequentlyAskedQuestions#basics-1

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.