1.在app下建一個Common文件夾 在Common下建一個function.php 放入公共函數
function test(){
echo 'this is a test';
}
2.在項目目錄下composer.json中加入
"autoload": {
"files":[
"app/Common/function.php"
]
}
3.在項目目錄下執行下面命令
composer dump-autoload
