Tomasz
Tomasz

Reputation: 1408

How to pass variable from one view to another using render

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

Answers (1)

nospor
nospor

Reputation: 4220

You should use partial - then you can pass additional variables:

$this->partial('oferta/opinia.phtml', array('i' => $i));

Upvotes: 2

Related Questions