Zend the difference between autoloadernamespaces[] and autoloadernamespaces

1k Views Asked by At

When setting up a custom library in Zend Framework what is the difference between autoloadernamepaces[] = "foo" and autoloadernamespaces.foo = "foo"?

1

There are 1 best solutions below

0
On

What you'll get in the config in the end is basically an array. One has a numerical index while the other has the provided key

autoloadernamespaces[] = "foo" 
// results into this
array(0 => "foo");

autoloadernamespaces.foo = "foo"
array("foo" => "foo");

The advantage with the latter would be that you can always address it with a name. This might be not needed with autoloader namespaces but for other configurations this could be a life saver.