Create documentations for PHP code with phpDocumentor
npm install grunt-phpdoc> Create documentations for PHP code with phpDocumentor
~1.0If you haven't used Grunt before, be sure to check out
the Getting Started guide, as it explains
how to create a Gruntfile as well as
install and use Grunt plugins. Once you're familiar with that process, you may
install this plugin with this command:
``shell`
npm install grunt-phpdoc --save-dev
Once the plugin has been installed, it may be enabled inside your Gruntfile
with this line of JavaScript:
`js`
grunt.loadNpmTasks('grunt-phpdoc');
installed globally in order to use this plugin.
** Please visit phpdoc.org for more information and
installation instructions.The "phpdoc" task
Run this task with the grunt phpdoc command.In your project's Gruntfile, add a section named
phpdoc to the data object
passed into grunt.initConfig(). Task targets, files, and options may be
specified according to the
Configuring tasks guide.`js
grunt.initConfig({
phpdoc: {
options: {
// Task-specific options go here
},
target: {
// Target-specific file lists and/or options go here
}
}
});
`$3
The available options for this task correspond to the options for phpdoc. For
more details refer to the documentation at
phpdoc.org.#### template
Type:
String
Default: 'clean'Select the template for the generated documentation. Run
phpdoc template:list
to get a list of available templates.#### verbose
Type:
Boolean
Default: falseDisplay the output of the
phpdoc command.$3
In this example, a documentation is built for all PHP files in the
app/controllers folder and for the file app/util.php. The result is stored
in doc/backend. If no dest property is specified, a doc folder will be
created automatically next to your Gruntfile.`js
grunt.initConfig({
phpdoc: {
options: {
verbose: true
},
src: [
'app/controllers',
'app/util.php'
],
dest: 'doc/backend'
}
});
`You can also build multiple documentations simultaneously. The following
configuration will create two separate documentations in the doc folder:
first for the PHP files in code/first and second for the ones in
code/second:
`js
grunt.initConfig({
phpdoc: {
files: {
'doc/first': ['code/first'],
'doc/second': ['code/second']
}
}
});
``