Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/laravel/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Laravel 不同文件夹中的LAVEL视图_Laravel_Laravel Blade_Laravel Views - Fatal编程技术网

Laravel 不同文件夹中的LAVEL视图

Laravel 不同文件夹中的LAVEL视图,laravel,laravel-blade,laravel-views,Laravel,Laravel Blade,Laravel Views,我有一个laravel项目,我有以下观点: 'ProjectName\custom\subfolder\resources\views\theview.blade.php' 如何返回此视图 我尝试使用视图(“theview”)但不起作用,因为它只对内部视图起作用: 'ProjectName\resources\views' 如何从Resources\views文件夹外部返回视图?在config/view.phpconfig文件中,添加到路径键: <?php return [

我有一个laravel项目,我有以下观点:

'ProjectName\custom\subfolder\resources\views\theview.blade.php'
如何返回此视图

我尝试使用视图(“theview”)但不起作用,因为它只对内部视图起作用:

 'ProjectName\resources\views'

如何从Resources\views文件夹外部返回视图?

config/view.php
config文件中,添加到
路径
键:

<?php

return [

    'paths' => [
        realpath(base_path('resources/views')),
        realpath(base_path('custom/subfolder/resources/views')),
    ],


    'compiled' => realpath(storage_path('framework/views')),

];

config/view.php
config文件中,添加到
路径
键:

<?php

return [

    'paths' => [
        realpath(base_path('resources/views')),
        realpath(base_path('custom/subfolder/resources/views')),
    ],


    'compiled' => realpath(storage_path('framework/views')),

];

绝对正确!就在Laravel 6.0中

'paths' => [
        resource_path('views'),
        resource_path('views/canaanmodels'),
    ],

其中我的视图位于文件夹'canaanmodels'中,该文件夹位于'views'floder中,realpath现在已替换为资源路径,不再有基本路径。。。希望它能帮助别人!干杯

绝对正确!就在Laravel 6.0中

'paths' => [
        resource_path('views'),
        resource_path('views/canaanmodels'),
    ],

其中我的视图位于文件夹'canaanmodels'中,该文件夹位于'views'floder中,realpath现在已替换为资源路径,不再有基本路径。。。希望它能帮助别人!干杯

谢谢你的回答,我应该如何调用视图?是的,使用
view('theview')
应该工作,它到底怎么不工作?谢谢你的回答,我应该如何调用视图?是的,使用
view('theview')
应该工作,它到底怎么不工作?