Welcome Guest, Not a member yet? Register   Sign In
View files or template

The basic idea is that you have to separate logic from presentation. Thats where the view in MVC comes in.

You could stop there, and have a single view file and use lots of lines of PHP code to produce your output, but that gets more and more difficult to maintain.

The main goal of a template system or parser is to remove part of the complexity, by having as few additions as possible to what should be a plain HTML file. So no PHP structures, no echo, but simple variable references. If you stick to CI views, you will still use PHP for control structures, and you have to be very careful not to make it a mess again.

We use Smarty as template engine, partly it allows use to do the above, but also because we have people working on the HTML side of things that either don't want to know PHP, or who do know PHP and could use their knowledge to alter business logic in views, or access data structures internal to the application, p.e. via the CI superobject.

Messages In This Thread
View files or template - by El Forum - 01-01-2010, 06:19 PM
View files or template - by El Forum - 01-01-2010, 07:03 PM
View files or template - by El Forum - 01-01-2010, 11:47 PM

Theme © iAndrew 2016 - Forum software by © MyBB