views:

325

answers:

2

In a Zend view I can apply a partial template to an iterable element as follows:

$this->partialLoop('template.phtml', $iterable);

However inside the template, only the elements of the $iterable are available, is there another way of passing extra data to the partial?

+3  A: 

I use

$this->partialLoop('template.phtml', array(
    'data' => $iterable, 
    'otherVariable' => $otherVariable
);
Tomáš Fejfar
Beat me to it. +1
smack0007
A: 

and in the template.phml which way you use it? and access the variable inside it?

Behrang
You'd do $this->data and $this->otherVariable, the same as in a View script
Ciaran McNulty
let me explain it more:I have two table artist (child table)and groups (parent table) one groups can have some artistI want to have groups name in my artist table view can I use it or must try something else
Behrang