[英]Laravel 5 - Change Models,Views,Controllers path
i have edited psr-4 on composer.json 我在composer.json上编辑了psr-4
"autoload": {
"classmap": [
"database"
],
"psr-4": {
"Marka\\Urun\\": "vendor/Marka/Urun/src/",
"App\\": "app/"
},
"files": [
"vendor/Marka/Urun/src/helpers.php"
]
},
I want to change file(routes.php, helpers.php and Models,Views,Controllers) pathes to : Vendor/Marka/Urun/ 我想将文件(routes.php,helpers.php和模型,视图,控制器)的路径更改为:Vendor / Marka / Urun /
How can I do it ? 我该怎么做 ?
You're trying to get some modular structure if I get it right. 如果我正确的话,您正在尝试获得一些模块化的结构。
If so, instead of trying to set a different namespacing from composer for each of your modules under vendor directory; 如果是这样,则不要尝试为供应商目录下的每个模块从composer设置不同的命名空间; i think you may try to use something like http://sky.pingpong-labs.com/docs/2.0/modules 我认为您可以尝试使用类似http://sky.pingpong-labs.com/docs/2.0/modules的工具
Otherwise as you may know, by using PSR-4 and directory structure, if you coded your files properly all necessary files would be loaded automatically as you named (namespaced) them. 否则,您可能会知道,通过使用PSR-4和目录结构,如果对文件进行了正确编码,则所有必需的文件都将按照命名(命名空间)的方式自动加载。
By the way, just in case you didn't know you may also need a ServiceProvider to boot everything up for Laravel on your package. 顺便说一句,以防万一您不知道自己可能还需要一个ServiceProvider来为您的软件包中的Laravel引导一切。
I also suggest you to read https://laravel.com/docs/5.2/packages if you need any help about development structure/functionality. 如果您需要有关开发结构/功能的任何帮助,我还建议您阅读https://laravel.com/docs/5.2/packages 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.