JMSSerializer stand alone - Annotation does not exist, or cannot be auto-loaded

前端 未结 6 1496
遥遥无期
遥遥无期 2020-12-13 18:00

I am attempting to use JMSSerializer as a stand alone library to map JSON responses from an API to my model classes and am running into some issues.

Executing the fo

6条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-13 18:54

    If you use Composer, you can get loader by specifying a path in require:

    $loader = require(__DIR__ . '/../vendor/autoload.php');
    AnnotationRegistry::registerLoader(array($loader, 'loadClass'));
    

提交回复
热议问题