philsturgeon / codeigniter-template

Template library for CodeIgniter which supports modules, themes, partial views, etc.
411 stars 178 forks source link

Load views from theme locations #29

Closed ruthlessfish closed 12 years ago

ruthlessfish commented 12 years ago

This function allows access to theme specific views without having to set a partial first. This is useful for nesting views on the fly.

controller $this->template->set('users', $users)->build('view1');

view1.php <ul> <?php foreach($users as $u): ?> <?php $this->template->load_view('list_item', $u) ?> <?php endforeach ?> </ul>

philsturgeon commented 12 years ago

Can you add this to the docs? :)

ruthlessfish commented 12 years ago

no problemo. i'll update it when I get back from lunch.

ruthlessfish commented 12 years ago

done and done.