4

I'm attempting to document class attributes using Doxygen. Currently, the protected attributes show up in the list at the top of the page for the specific class. I'd like to put an explanation for them.

I've tried using @param [name] [description] both above the beginning of the class and right above the declaration of the attributes. I even tried putting them into the docblock for my constructor class and it just broke it.

Is there something I'm just missing?

-- Logan

Logan Bibby
  • 1,167
  • 1
  • 10
  • 31

2 Answers2

5

You have to use < or comment right before the attribute:

class cMainData
{
    private $attr;  //!< This is my attribute

    //! This is another attribute
    private $otherAttr;
}

Note that you can use @brief, @note and similar e.g.:

class cMainData
{
    private $attr;  //!<@brief This is my attribute.
                    //!< This is some additional info about this attribute.
}
Nux
  • 9,276
  • 5
  • 59
  • 72
  • Ohh! That's exactly what I needed! Sadly enough, it's been nearly four months since I asked this question and it still hasn't been answered. Thanks!! – Logan Bibby Dec 20 '10 at 02:16
1

I've posted a workaround as an answer to a duplicate of this question: Doxygen: how to describe class member variables in php? It may be useful to link it from here for others that need solution compatible with phpDoc annotation style.

Community
  • 1
  • 1
Goran Rakic
  • 1,789
  • 15
  • 26