简体   繁体   中英

Add custom php functions file to all Bolt CMS extensions

There's a list of functions I'd like to have available to all of my local extensions. Is there a seamless way to include a "functions.php" file so that all of my extensions have the PHP functions available to use?

Define a "master" extension, make your other extensions "require" that master, and expand on the "autoload" section, something like this example:

"autoload" : { "files" : [ "init.php" ], "psr-4" : { "Bolt\\\\Extension\\\\Gawain\\\\Cord\\\\" : [ "", "src/" ], "Book\\\\Library\\\\" : "lib/" }, "classmap" : [ "vendor/NameLess/" ] }, See the Composer autoload docs for more info.

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