简体   繁体   中英

js components autoload psr4

My Composer.json's autoload section as follows

"autoload": {
    "psr-4": {
        "Xx\\Cloud\\Jquery\\": "/src/components/jquery/jquery.min.js",
        "Xx\\Cloud\\Angular\\": "/src/components/angular.js/angular.min.js",
        "Xx\\Cloud\\Angular\\Route\\": "/src/components/angular-route/angular-route.min.js"
    }
}

Is this make sense?

Answers could range from "Not at all" to "absolutely in this case" .

Not at all is my best guess as I think it is most likely the way you ask the question. Here is why:

PSR-4 is a definition to autoload PHP class files .

In your example paths with the js extension are given which suggest those are not PHP but Javascript files.

Unless the path given are directories (that are easy to mistake by look as filenames) or are PHP files (that are easy to mistake by look as Javascript not PHP files), this makes no sense at all.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM