I am confused of the concept of templates in PHP. What does it really mean?What is the concept of templates in php? template
Asked
Active
Viewed 121 times
-7
-
can any one help me what does templates used for and what does it really means in PHP. – expkib Aug 28 '15 at 17:46
-
What is confusing you about templates? There are a number of templating sytems in PHP like twig, blade, smarty, etc. They are generally used to separate PHP logic from the display – samlev Aug 28 '15 at 17:47
-
try this: http://www.smashingmagazine.com/2011/10/getting-started-with-php-templating/ – samlev Aug 28 '15 at 17:48
-
or this: http://stackoverflow.com/questions/436014/why-should-i-use-templating-system-in-php – thoughtrepo Aug 28 '15 at 17:49
-
even this: http://www.phpro.org/tutorials/Introduction-to-PHP-templating.html – DirtyBit Aug 28 '15 at 17:49
-
really helpful refrences thanks for that.now I got it. – expkib Sep 02 '15 at 22:38
1 Answers
1
A template is basically a visual representation of something (like data I.E), can be dynamic or not, the template should hold placeholders that will be replaced with values passed to the template. Usually a template is a skeleton that should serve only as the visual representation (styles, markup). The main purpose of templates is to separate the logic from the visualization.
In MVC, the templates would be the View Layer.

taxicala
- 21,408
- 7
- 37
- 66