UPDATE: It was fast! I admit that testing is very bad here, but it works if you use New -> PHP Class... through the user interface. Then you select the namespace from the drop-down list. And voila. I used New -> PHP File... which does not provide a drop-down namespace space (oddly enough, or maybe I missed something). Customize the PHP class template if necessary. Sorting criterion.
I scratched my head about this too and found the following error report . In accordance with the instructions (at the bottom), you edit the template file and add:
<#if namespace?? && namespace?length > 0> namespace ${namespace}; </#if>
Netbeans then makes guest access based on the location of the files and other possible namespaces in the directory. To be honest, I still managed to do this, but I'm sure I'm not far off ... maybe ... U_U
I will definitely update this if so.
SIDE Note . You can add any variables that you want to use in the template. Go to (on windows) \AppData\Roaming\NetBeans\7.4[your version here]\config\Templates\Properties\User.properties (create it if it is missing)
Then create something like this:
user=Ms Angelina Jolie Lookalike Honest <no.spam.thanks@gmail.com> organization=the.Evolution.of.Awesome package=SunshineInACan package2=Framework/UserInterface
Then in your template do something like this:
/** * @DNADO Type description * * @package ${package}.${package2} * @subpackage * @category * @author ${user} * * @copyright ${date?date?string("yyyy")} ${organization} */
Then ... disco;)
What I also do to save a little time is to set common parameters in one variable and just delete as applicable after creating the file. For example, ${package2} is either "Framework" or "UserInterface" not both (or both, if I forgot, you know how this happens).
Just plain high
source share