2009年4月15日星期三

Re: [fw-mvc] Proposed addition to Zend_Application API

On 13 Apr 2009, at 15:50, Matthew Weier O'Phinney wrote:

> The idea here would be that if a resource method or plugin has a
> non-null return value, then that value would be registered with the
> registry.

I really like this idea.

> Because the resource now has an explicit return value, the Bootstrap
> would register it with the local registry. To keep things simple and
> consistent, the key would match the resource. So, if you wanted to
> retrieve the router, you'd use this:
>
> $router = $registry->router;
>

How would it know which key name to use?


> In your action controllers, you'd use the following:
>
> $registry = $this->getInvokeArg('registry');
> $router = $registry->router;
>

Looks good, though the InvokeArg's name could be clearer as 'registry'
implies that it's to be used for all registry things.


Regards,

Rob...

没有评论: