2009年9月4日星期五

Re: [fw-mvc] Bootstrap getResourse

-- whisher <whisher@mp4.it> wrote
(on Friday, 04 September 2009, 07:20 AM -0700):
> Hi. What's the best way to retrieve a resourse in the bootstrap ? $this->
> bootstrap('db'); $resource = $this->getResource('db'); or $resource =
> $bootstrap->getPluginResource('db'); Thanks in advance. Bye

The first:

$this->bootstrap('db');
$db = $this->getResource('db');

getPluginResource() returns the actual resource plugin object -- and
clearly won't work for class-based resources -- while getResource()
returns whatever was generated when running a given resource.

--
Matthew Weier O'Phinney
Project Lead | matthew@zend.com
Zend Framework | http://framework.zend.com/

没有评论: