Skip to content

Commit

Permalink
更新文档
Browse files Browse the repository at this point in the history
  • Loading branch information
Yurunsoft committed May 15, 2020
1 parent 0c547e6 commit 744102d
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
1 change: 1 addition & 0 deletions doc/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@

* [注入值注解](annotations/injectValue.md)
* [方法参数过滤器](annotations/filterArg.md)
* [注解相关问题](annotations/qa.md)

## 命令行工具

Expand Down
38 changes: 38 additions & 0 deletions doc/annotations/qa.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# 注解相关问题

本页列出注解相关常见问题,欢迎大家补充。

* **如何忽略一些我不想被扫描到的类?**

在项目配置文件中配置:

```php
return [
// 忽略扫描的命名空间
'ignoreNamespace' => [
'Imi\Test\Component\Annotation\A\*', // 忽略扫描该命名空间下所有类
'Imi\Test\Component\Annotation\B\TestB',// 忽略该类
],
]
```

* **怎样忽略扫描指定注解**

在项目的 `Main.php` 中写入:

```php
<?php
namespace ImiApp;

use Imi\Main\AppBaseMain;
use Yurun\Doctrine\Common\Annotations\AnnotationReader;

class Main extends AppBaseMain
{
public function __init()
{
AnnotationReader::addGlobalIgnoredName('xxx');
}

}
```

0 comments on commit 744102d

Please sign in to comment.