Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

DevShed:
Moving Presentation Logic Out of Views with CodeIgniter
Apr 17, 2009 @ 12:53:38

On DevShed today they continue their introduction to CodeIgniter series with this new tutorial looking at views nd how to move some of the presentation logic out of them an into a "sub-view container".

Manipulating views with CodeIgniter is a straightforward process. [...] However, CodeIgniter gives PHP programmers enough freedom to handle views in several useful ways, which can speed up the development of web applications. Therefore, if you’re taking your first steps with CI and wish to learn some handy approaches that will help you work with views in a truly painless fashion, then start reading this tutorial now!

Their method defines a reusable view "container" (their content_view.php) to handle the looping that was previously just done in the one view for the user listing. This makes the content_view script reusable across more than one view and standardizes some of the look/feel in the view's output.

tagged: codeigniter presentation logic view tutorial container

Link:


Trending Topics: