2

I have a php project in my Zend Studio which has the Subfolders src/ vendor/ (Silex). In my src folder i have a folder Structure like Company/Project/...

When i want to create a new class via the wizard, in my other projects it fills in the namespace in the "new class" window.

In this project this doesn't work when i use new "PHP Class", when i use new "Class" it uses the folder structure like: src\Company\Project.....

So how can i set namespaces for my source folders? Or is this a error because I thought they will be detected automatically?

Johni
  • 2,933
  • 4
  • 28
  • 47

2 Answers2

0

Since the 'connection' between folders and namespace is not built-in PHP (as it is in Java for instance), I guess it won't be available directly in any IDE.

Although the PHP Fig (PHP Framework Interop Group) defined in it's PSR0 : \Symfony\Core\Request => /path/to/project/lib/vendor/Symfony/Core/Request.php for instance, it may be added. By the way it's not part of the core of PHP.

I'm not using Zend Studio but Netbeans which does not support namespace for new Classes either (but at least it's free!)

magnetik
  • 4,351
  • 41
  • 58
0

Just a guess, but are you sure you have your project configured for PHP 5.3+ support?

jsteinmann
  • 4,502
  • 3
  • 17
  • 21