Composer autoloader + slim framework - fatal error: Class 'Slim\Slim' not found?

前端 未结 2 568
隐瞒了意图╮
隐瞒了意图╮ 2021-01-25 12:30

How can I use composer autoloader to load slim? I have it a go below,

composer.json:

{
    \"autoload\": {
        \"psr-4\": {
                 


        
相关标签:
2条回答
  • 2021-01-25 13:08

    You can just use ...

    {
        "require": {
            "slim/slim": "2.*"
        }
    }
    

    http://docs.slimframework.com/

    0 讨论(0)
  • 2021-01-25 13:19

    If you prefer to keep slim under ext (as you mentioned here Slim framework - How to autoload Slim/Slim.php instead of using require?) instead of using it as a composer package, I believe this will work:

    {
        "autoload": {
            "psr-0": {
                "": "ext/"
            }
        }
    }
    
    0 讨论(0)
提交回复
热议问题