File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -124,6 +124,21 @@ To disable the annotation loader after it was enabled, call
124
124
In order to use the annotation loader, you should have installed the
125
125
``doctrine/annotations `` and ``doctrine/cache `` packages from `Packagist `_.
126
126
127
+ .. tip ::
128
+
129
+ Remember that annotation classes aren't loaded automatically, so you should load
130
+ them like Symfony usually does in the ``app/autoload.php `` file::
131
+
132
+ use Composer\A utoload\C lassLoader;
133
+ use Doctrine\C ommon\A nnotations\A nnotationRegistry;
134
+
135
+ /** @var ClassLoader $loader */
136
+ $loader = require __DIR__.'/../vendor/autoload.php';
137
+
138
+ AnnotationRegistry::registerLoader([$loader, 'loadClass']);
139
+
140
+ return $loader;
141
+
127
142
Using Multiple Loaders
128
143
----------------------
129
144
You can’t perform that action at this time.
0 commit comments