Reputation: 97
what is the meaning of /** in php example
/**
* Method to display a view.
*
* @param boolean If true, the view output will be cached
* @param array An array of safe url parameters and their variable types, for valid values see {@link JFilterInput::clean()}.
*
* @return JController This object to support chaining.
* @since 1.5
*/
i cant seem to search about it? what is the keyword to use for me to be able to search on it? does it go into the code or just a comment?
Upvotes: 6
Views: 5292
Reputation: 2406
This is the start of a comment which is to be turned into functional documentation by a documentation generator like Doxygen. The /*
part starts a normal PHP comment ended by */
, and the extra asterisks tags the comment as meta-data for external processing.
Upvotes: 1
Reputation: 3522
It is the start of a doxygen comment. See http://www.doxygen.nl/index.html. Doxygen creates documentation from specially formatted comments. @param and @returns are tokens recognized by doxygen. Doxygen is nearly an industry standard as a way of creating programmer documentation for many languages and output styles. It scans source files, gathering information left by the coder in comments and then creates documents in various formats such as HTML, Latex, and more.
Upvotes: 1
Reputation: 2703
This is called DocBlock style commenting. In general, code should be commented prolifically. It not only helps describe the flow and intent of the code for less experienced programmers, but can prove invaluable when returning to your own code months down the line. This is not a required format for comments, but it is recommended.
DocBlock style comments preceding class and method declarations so they can be picked up by IDEs:
/**
* Super Class *
* @package Package Name
* @subpackage Subpackage
* @category Category
* @author Author Name
* @link http://example.com
*/
class Super_class {
Source:Click!
In IDEs like netbeans,this commenting style is detected and the * pointers are automatically generated (like in listing pointers). All you have to do is open /**
and press Enter!
Upvotes: 9
Reputation:
The /*
is a multi line comment tag. That's the opening tag, and */
is the closing tag.
Upvotes: 0
Reputation: 8415
The /**
, as noted a number of times, is the start of a PHP comment block. You can read more about PHP comments in the PHP manual.
The information in the comment block is there to describe the method below it. Joomla uses PHPDoc to automatically build documentation pages using tags such as @param
and @return
. You can read more about Joomla's documentation standards on this page.
Upvotes: 1
Reputation: 191779
/*
starts a multi-line comment, ended with */
/**
is special for phpdoc and possibly some other PHP documentation-generation software. You have to use /**
for this software to pick up comments and create the documentation from them. /*
only will not do it.
Upvotes: 3
Reputation: 19733
/* content goes here */
Is used for commenting text out in PHP.
You can also use:
//content goes here
which will comemnt everything on that specific line
Upvotes: 0
Reputation: 10066
It's simply used to comment a block of code. Here is an example:
/* here is a block of code
And some more
And some more */
You can also comment single lines with // like this:
//this is a comment
Upvotes: 1
Reputation: 360762
/*
starts a comment. Anything else after that, until the first */
is part of the comment, so the second *
in /**
is nothing special - just part of the comment. Some in-line documentation/code annotation systems may find it significant, but to PHP it means absolutely nothing.
Upvotes: 4