> 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...
没有评论:
发表评论