Composer/PSR - How to autoload functions?

前端 未结 3 1697
说谎
说谎 2020-12-03 09:49

How can I autoload helper functions (outside of any class)? Can I specify in composer.json some kind of bootstrap file that should be loaded first?

3条回答
  •  情歌与酒
    2020-12-03 10:12

    You can autoload specific files by editing your composer.json file like this:

    "autoload": {
        "files": ["src/helpers.php"]
    }
    

    (thanks Kint)

提交回复
热议问题