2011年2月10日星期四

[fw-mvc] Re: (v1.7.2)

weierophinney wrote:
>
> -- nphilliy <nathaniel.phillips@photobox.com> wrote
> (on Thursday, 10 February 2011, 06:14 AM -0800):
>>
>> I am currently forced to use zend framework 1.7.2
>>
>> I have a problem with the partial function
>>
>> $this->partial('template.html', array('arg1' => 'value1'));
>
> * Use render(), and make sure the variables are already in the view
> script scope, or assigned to the view. In terms of having them in the
> view script scope:
>
> <?php
> $arg1 = 'value1';
> echo $this->render('template1.phtml'); // template can now refer to
> $arg1
>
>

Don't you mean:

<?php
$this->arg1 = 'value1';
$this->render('template1.phtml');
?>

Render is a bit faster than partial, so if the scope bleed isn't a problem,
I'd use render().

Cheers,
David
--
View this message in context: http://zend-framework-community.634137.n4.nabble.com/partial-and-render-parameters-v1-7-2-tp3299188p3300635.html
Sent from the Zend MVC mailing list archive at Nabble.com.

没有评论: