CodeIgniter Forums
Template parsing - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Template parsing (/showthread.php?tid=60466)



Template parsing - El Forum - 04-02-2014

[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?


Template parsing - El Forum - 04-08-2014

[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.