[eluser]Colin Williams[/eluser]
I'll try to do it quick.
Here's a view at application/views/basic.php:
Code:
<strong>Name:</strong> <?= $name ?>
And here's a basic controller method:
Code:
function show_name()
{
$data = array('name' => 'John');
$this->template->write('content', 'fancy', $data, 'basic');
$this->template->render();
}
The template just echoes the 'content' region:
Code:
<?= $content ?>
So, when we fire up this controller method, since we have a basic.php view and not a fancy.php view, we see:
Quote:Name: John
Now, lets add a view at application/views/fancy.php
Code:
<strong>Fancy Name:</strong> <?= $name ?>
Now when we fire up the controller method, we should see:
Quote:Fancy Name: John
This type of cascade can be applied to a number of scenarios (opt-in template specialization, theme systems, etc)