Thanks for the reply, Marco.

While I haven't been that fortunate to deal with a lot of modern code that uses 
namesapces, I'm familiar with the
concepts. I re-read the manual before posting just in case I was missing 
something simple and I didn't think that I was.

Here's my understanding, please correct me if I'm wrong:

The static method createReaderForFile() is in the class PHPExcel_IOFactory, 
which lives within the PHPExcel directory.
Since the library doesn't use namespaces, underscores denote a subdirectory - 
just like in ZF1.

Give the fact that the PHPExcel class lives in 
/vendor/phpoffice/phpexcel/Classes and the autoload_namespaces.php maps
'PHPExcel' to that directory, I would expect that by adding the 'use' statement 
in another file would permit access to
the method without any namespace prefixes or separators. I can see that if I 
omitted the use, then without the leading
'\', PHP would think that I'm referring to a class that's in the current 
namespace, but that's not the case.

Everything I've ready seems to back up that theory, but since it's not working 
as expected, I'm still missing something.

-Brad

P.S. That 2 min video is great - I'll have to pass it on to colleagues who are 
namespace-ignorant.

On 3/13/2013 12:16 PM, Marco Pivetta wrote:
> Correct. That's basic PHP namespaces knowledge though.
> 
> Here's a couple of resources you should read up before dealing with 
> namespaces:
> 
> The manual (obviously): http://php.net/manual/en/language.namespaces.php
> Namespaces in 120 seconds: http://www.youtube.com/watch?v=d1kDT8YFAhI
> 
> Marco Pivetta
> 
> http://twitter.com/Ocramius     
> 
> http://ocramius.github.com/

-- 
List: [email protected]
Info: http://framework.zend.com/archives
Unsubscribe: [email protected]


Reply via email to