2009年4月23日星期四

Re: [fw-mvc] Zend_Application: autoloadernamespaces in config file

-- Jeroen Keppens <jeroen.keppens@gmail.com> wrote
(on Thursday, 23 April 2009, 04:03 AM -0700):
> Jeroen Keppens wrote:
> > autoloadernamespaces = Amz
> >
> > But this failed miserably, the reason being that the function that
> > processes this expects an array and not a string.
> >
> > What is the syntax in the init file to allow a value to be processed
> > as array? I tried a comma seperated list with squared brackets
> > ["Zend", "Amz"] but that didn't work either.
> >
>
> Ok, after some more investigating/trial&error I tried the following in
> the ini file:
>
> autoloadernamespaces[] = Amz
>
> This worked beautifully.

You can also do this:

autoloadernamespaces.amz = "Amz"

While a bit more verbose, it's another way to force an array.

BTW, if you are following ZF naming conventions, suffix your namespaces
with a '_': "Amz_". This will ensure it doesn't match something longer
(such as "Amzd").

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

没有评论: