-
-
Notifications
You must be signed in to change notification settings - Fork 169
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'); | ||
} | ||
|
||
} | ||
``` |