【问题标题】:How to link to official PHP documentation in phpDocumentor 2?如何链接到 phpDocumentor 2 中的官方 PHP 文档?
【发布时间】:2017-01-03 04:21:17
【问题描述】:

我使用 phpDocumentor 2 来描述一些方法。我想链接到原生函数的官方 PHP 文档。我可以这样写:

/**
 * @see http://php.net/manual/en/function.ucfirst.php ucfirst
 */

这些不起作用:

/**
 * @see ucfirst
 * @see \ucfirst
 */

有没有更好的方法?我正在寻找这样的东西:

/**
 * @the-official-documentation-for ucfirst
 */

【问题讨论】:

  • 我没听明白?你到底想完成什么?
  • 是的,你可以这样写。
  • @Anant 我更新了问题。
  • 哦,所以您想在每个代码或函数上方设置文档链接?我对吗?如果是,我认为第一个是正确的
  • @Michas 是的,它应该可以工作。我刚刚测试过,没有在Sublime text 上工作,但在phpStorm 上工作。您是真的,官方文档没有区别。

标签: php phpdoc


【解决方案1】:

您在文档中的语法存在一些问题。您应该使用@link 而不是@see

/**
 * @see http://php.net/manual/en/function.ucfirst.php ucfirst
 */

将您的文档代码更改为

/**
 * @link http://php.net/manual/en/function.ucfirst.php ucfirst
 */

我已经对其进行了测试,并且正在使用我的编辑器,即phpStorm

注意:它只适用于functionsclass 名称。你不能在 cmets 上使用它。

【讨论】:

  • 我在 phpDocumentor 2 中看不到 @see@link 的任何差异。在 PSR-5 草案中,@link 已被弃用。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2013-07-12
  • 2011-11-06
  • 2022-11-11
  • 1970-01-01
  • 2014-11-11
  • 1970-01-01
  • 2018-07-08
相关资源
最近更新 更多