2009年2月24日星期二

Re: [fw-mvc] Initializer.php

-- keith Pope <mute.pop3@googlemail.com> wrote
(on Tuesday, 24 February 2009, 07:42 PM +0000):
> Am I right in assuming that then in your action controllers you would
> use, new Module_Model_Item(); etc to access the resources? Rather then
> using the action helper.

In most cases, yes. One aspect of the resource autoloader is that it can
also act as an object factor/registry, which also gives you this:

$model = $loader->getModel('Item');

optionally passing it an array of parameters to pass to the constructor.
In most cases, however, keeping the same instance of the class around
isn't really necessary, so using normal instantiation is the primary use
case.

> 2009/2/23 Matthew Weier O'Phinney <matthew@zend.com>:
> > -- keith Pope <mute.pop3@googlemail.com> wrote
> > (on Monday, 23 February 2009, 07:17 PM +0000):
> >> Ok that would be great, I am currently writing a chapter that will
> >> need to make use of Zend_Application, Autoloader etc at some point so
> >> just trying to get my head around it early. I am happy to give
> >> feedback etc as I progress.
> >>
> >> Great components btw a real plus for the framework imho, bootstrapping
> >> will be a dream once we have this and with the autoloader my own
> >> library can shrink loads now :)
> >>
> >> One thing that I was wondering was if the ResourceLoader action helper
> >> will be in the 1.8 release?
> >
> > Not the action helper, but Zend_Loader_Autoloader_Resource and
> > Zend_Application_Module_Autoloader. I discussed the resource loader with
> > the original author, and he and I agreed that autoloading was a more
> > robust and elegant solution.
> >
> > And yes, for 1.8. It's feature complete in the incubator already.
> >
> >> 2009/2/23 Matthew Weier O'Phinney <matthew@zend.com>:
> >> > -- keith Pope <mute.pop3@googlemail.com> wrote
> >> > (on Monday, 23 February 2009, 06:09 PM +0000):
> >> >> I was having a bit of trouble getting the usecases to work from
> >> >> dasprids branch, is it a fully working prototype or was I just being
> >> >> stupid?
> >> >
> >> > I made a ton of updates over the weekend; make sure your checkout is
> >> > up-to-date. If it is, and you're still having trouble, I'll work up more
> >> > examples in the next day or so.
> >> >
> >> > (Both Ben and I are committing in that branch currently)
> >> >
> >> >> 2009/2/23 Matthew Weier O'Phinney <matthew@zend.com>:
> >> >> > -- Ed Lazor <edlazor@internetarchitects.biz> wrote
> >> >> > (on Monday, 23 February 2009, 09:25 AM -0800):
> >> >> >> > You may want to look at the current Zend_Application prototype instead:
> >> >> >> >
> >> >> >> >    http://framework.zend.com/svn/framework/standard/branches/user/dasprid/Zend_Application
> >> >> >>
> >> >> >> Is that going to be the new standard?
> >> >> >
> >> >> > Yes.
> >> >
> >> > --
> >> > Matthew Weier O'Phinney
> >> > Software Architect       | matthew@zend.com
> >> > Zend Framework           | http://framework.zend.com/
> >> >
> >> >
> >>
> >>
> >>
> >> --
> >> ----------------------------------------------------------------------
> >> [MuTe]
> >> ----------------------------------------------------------------------
> >>
> >
> > --
> > Matthew Weier O'Phinney
> > Software Architect       | matthew@zend.com
> > Zend Framework           | http://framework.zend.com/
> >
> >
>
>
>
> --
> ----------------------------------------------------------------------
> [MuTe]
> ----------------------------------------------------------------------
>

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

没有评论: