News Feed
Sections




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

AskAboutPHP.com:
CodeIgniter Organizing views simply
October 29, 2008 @ 15:35:08

New on the AskAboutPHP.com blog, this tutorial concerning CodeIgniter view organization has been posted:

Trying my hands at using CodeIgniter, one of the first obstacles I had was how to organize my 'blocks' on a page. Without knowing any better, I thought I had to reiterate the same view calls in every function within the controller, making the controller codes very messy. It turns out that CodeIgniter allows us to nest views within views, and that has made things a lot simpler for me.

Instead of loading and calling the view() method over and other in his actions, he chooses to make a "template" view with each of the other calls to view() contained inside. Then you just pass in the data you want the view to render and call that template view. This also allows you to easily create a site-wide template.

0 comments voice your opinion now!
codeigniter framework organize view template container


blog comments powered by Disqus

Similar Posts

Zend Developer Zone: Zend Framework Code Freeze (0.6.0 is Coming)

Community News: Too Many Frameworks? (Andrei Zmievski and Clay Loveless)

Daniel Krook's Blog: Technologies of the day: CakePHP & CodeIgniter

Phil Sturgeon's Blog: Why CodeIgniter HTML helper functions rock

Jani Hartikainen's Blog: What would make template engines actually useful?


Community Events

Don't see your event here?
Let us know!


introduction voicesoftheelephpant laravel version series community video interview library language unittest security release api podcast php7 example laravel5 framework opinion

All content copyright, 2015 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework