views:

102

answers:

3

I'm documenting the company framework for use with our default IDE (Netbeans).

It's normal that we send as params a new Object, like here:

$this->addControl(new TextControl('name', 'value'));

I could document the __construct() params at the normal place, but they aren't showed when you do a new <ctrl+space>.
So I tried to move this doc to the class doc. So when u type new it shows that info.
But it still doesn't help me autocompleting all the constructor parameters.

Is there any way to do this?

I would like to have an autocomplete for parameters when first instantiating the class.

[EDIT] I have this code:

/**
 * Classe da tag &lt;textarea&gt;
 * @param string $_name Nome do Controle e da tag
 * @param string $_label Texto que aparecerá antes do campo
 * @param string $_extra Usado para passar algum atributo a mais, como 'wrap'
 * @example $this->addControl(new TextAreaControl("comentarios", "Comentários: ", "wrap='off'"))
 */
class TextAreaControl {
[...]

    function TextAreaControl($_name, $_label, $_extra = "") {
     [...]
    }

    [...] 
}
A: 

Is your framework within the scope of the project? If it's in a seperate directory, you have to right click on your project, choose properties, and there should be something about "included files". Add your framework directory to this list, and Netbeans will parse the files.

Or are you talking about the class's phpdoc? If so, paste what you have here, because Netbeans should pickup on it automatically.

ryeguy
A: 

Put the doc-block above the constructor rather than the class, as you would for any other method.

Greg
A: 

The answer is: Netbeans only understand __construct() methods as class constructors.

You can document your class normally, and your constructor method normally, but using __construct().
This way, when you do a $var = new Class<ctrl+space> it will show you the normal data for the constructor method.

Igoru