passing variable to partial loop
Could it be possible to pass the values in partial loop. for code
EDIT:: in my file where partial is called, i've another array to pass. and i want S/N for array
<?php echo $this->partialLoop("partials/destination.phtml", $this->deslist);?>
and i my part开发者_StackOverflowial/destination.phtml file i have
<td><?php echo ++$count; ?></td>
i am getting warning message
Notice: Undefined variable: count in
/var/www/globaltours.com/application/modules/admin/views/scripts/partials/destination.phtml
on line 2 1
i wanted to display the count(order) of the items
View variables are in $this
; use $this->count
to access the count
variable:
<td><?php echo ++$this->$count; ?></td>
Assuming you have passed the variable to the view like this:
$view->partialLoop('view-script.phtml', array(
// loop 1
array(
'count' => 0,
'other_variable' => 'value',
'other_variable' => 'value',
),
// loop n
array(
'count' => 0,
'other_variable' => 'value',
'other_variable' => 'value',
),
));
You miss something like:
$count = 0;
精彩评论