Welcome Guest, Not a member yet? Register   Sign In
Template parsing
#1

[eluser]Andrewkha[/eluser]
Hi there

Another stupid question from newbie.
What is the benefit of using templates in PHP development and in CI in particular? What I was able to understand from the manual, parsing templates is pretty the same process as using

Code:
$data = array(...)
$this->load->view('view', $data);

It also replaces some specific items in html code with values that we pass to it.

So what's the difference?
#2

[eluser]Karman de Lange[/eluser]
We use template mostly for email generation. So you can edit and save the template in a DB (from admin console) and then parse the string to the template parser after reading it again from DB. There is no php etc code needed so no security issues and normal end user can use it as well.

99% of the time for actual web pages we use the normal way.




Theme © iAndrew 2016 - Forum software by © MyBB