Cookbook

Integrate javadocx with Zend Framework 2

Warning

To run javadocx with Zend Framework 2 it is mandatory to use the package that supports namespaces. This package is available for Advanced and Premium licenses.

  • 1- Copy the content of the javadocx package and paste it in the directory vendor/javadocx.
  • 2- Open the file composer.json and add the following classmap in the autoload section:
    "vendor/javadocx/Classes/javadocx"
In a clean installation of Zend Framework 2, this section should look like this:

  • 3- Update the autoloader of Composer:

With these three easy steps you are ready to work with javadocx. As a practical example, let’s create a document in a controller and save it in the public directory with the name output.docx: