Created
August 5, 2011 17:31
-
-
Save fabriziomachado/1128050 to your computer and use it in GitHub Desktop.
application/views/peoples/index.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## conteúdo da view index.php | |
<h2>application::views::welcome::show</h2> | |
<h1>Rendering a partials with locals</h1> | |
<!-- inclui uma partial sem loop, apenas passando variaveis locais --> | |
<?= render_partial('people/_list_people.php', $locals_vars ); ?> | |
<h1>Rendering a collection of partials</h1> | |
<!-- passando uma collection o conteúdo da partial é inserida a cada linha do loop --> | |
<?= render_partial('people/_people.php', | |
$locals_vars, | |
$people ); ?> | |
## conteúdo da partial _peoples.php | |
<? if($say_hello) ?> Hello, <?= $people->name ?> (<?= $people_counter ?>) <br/> | |
## conteúdo da partial _list_people.php | |
<? foreach($people as $person): ?> | |
<?= $say_hello ?>, <?= $person->name ?> <br /> | |
<? endforeach; ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment