Reputation: 1408
In one view kat.phtml I have variable $i
and I'd like to use this $i
in another view opinia.phtml
. How to pass this $i
?
<?php for ($i = 0; $i < count($this->allProd); $i++) : ?>
<?php echo $this->render('oferta/opinia.phtml'); ?>
<?php endif ;?>
Upvotes: 0
Views: 92
Reputation: 4220
You should use partial
- then you can pass additional variables:
$this->partial('oferta/opinia.phtml', array('i' => $i));
Upvotes: 2