The problem is that the default "clean" template does not support this feature. Other templates (like "responsive" for example) do. You can use the --template="responsive" flag to change the default template used.
Using @package instead of namespace in PhpDocumentor 2
-
10-06-2023 - |
题
I have a large code library for which I am trying to generate hierarchical documentation. The project does not use namespaces but uses @package instead.
I just tried generating docs as a test from the following file with phpDocumentor2:
<?php
/**
* This is a file
* @package JustAn\Example
**/
/**
* Something class
**/
class Something{
function try_this(){
}
}
Though according to the docs @package JustAn\Example should be the equivalent of namespace JustAn\Example, I found this not to be the case.
When I use namespaces the resulting documentation is like this:
When I use the @package notation the result looks like this (even though it recognizes the package notation - this is shown on the full details page of the class):
I am looking for a way to get the hierarchical result without having to rewrite the code to use 'real' namespaces.
解决方案
其他提示
I see that you have the package tag in the file docblock, but not the class docblock. If you add it to your class docblock, I think it should work.