2008年11月4日星期二

Re: [fw-mvc] Nested Partials

On Tue, Nov 4, 2008 at 2:06 PM, Matthew Weier O'Phinney
<matthew@zend.com> wrote:
>> So what do you suggest? Should I just have everything in a large
>> partial? That's a little frustrating because it could become quite
>> large.
>
> It depends on how you're using partials. I see a lot of people doing the
> following:
>
> <?= $this->partial('foo.phtml') ?>
>
> What's wrong with the above? The two primary features of partial() are
> to provide the ability to render view scripts from another module, and
> to provide a protected variable scope. If you're not doing either of
> these things, then there's no reason to use it over render() -- in fact,
> it's *better* to use render() in such a case, as it will be faster.

Awesome. I must have missed render() in the docs. I guess I need to
do a little RTFM.

Thanks,
-=Dan

没有评论: