Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/38.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
Php Css与laravel项目不起作用(布局使用)_Php_Css_Laravel - Fatal编程技术网

Php Css与laravel项目不起作用(布局使用)

Php Css与laravel项目不起作用(布局使用),php,css,laravel,Php,Css,Laravel,我与该组织有一个laravel项目供我参考: view/ ----- layout/ ----- ----- index.blade.php ( the main file where i call, another by extend ) ----- service/ ----- ----- index.blade.php (service page ) ----- about_us/ ----- ----- index.blade.php (

我与该组织有一个laravel项目供我参考:

 view/
    ----- layout/
    ----- ----- index.blade.php ( the main file where i call, another by extend )
    ----- service/
    ----- ----- index.blade.php (service page )
    ----- about_us/
    ----- ----- index.blade.php ( about page ) 
    ----- home/
    ----- ----- welcome.blade.php (my home page )
我的路线文件:

 Route::get('/', function () {
        return view('home/welcome');
    });

    Route::get('/a_propos', function () {
        return view('a_propos/index');  
    })->name('a_propos');

    Route::get('/team', function () {
        return view('team/index');
    })->name('team');

    Route::get('/avis_clients', function () {
        return view('avis_clients/index');
    })->name('avis_clients');

    Route::get('/nos_services', function () {
        return view('nos_services/index');
    })->name('services');

    Route::get('/blog', function () {
        return view('blog/index');
    })->name('blog');

    Route::get('/article', function () {
        return view('blog/show');
    })->name('article');

    Route::get('/contacts', function () {
        return view('contacts/index');
    })->name('contacts');

    Route::get('/faq', function () {
        return view('faq/index');
    })->name('faq');
我的服务页面如下所示:

@扩展(“布局/索引”)
@第节(“内容”)
.......
只是更多的HTML
.......

@endsection
似乎您使用了由laravel生成的默认欢迎文件,检查您的其他文件是否编写了正确的
@extends('layout.index')
而不是
@extend('layout.index')
开始时我发现了我的问题, 它的方式,我已使我的扩展不是“/”而是“.”在链接中


@扩展(“a_propo.index”)

你所说的“它不起作用”是什么意思?如果你不发布相关文件,很难说出为什么“它不起作用”;即视图。对不起,我将添加它!“它不工作”意味着在我的导航器中我只得到html,没有css!我不知道我是否解释对了,你在其他文件中导入了css文件了吗?也许对于CSS工作的文件,你导入了一个模板?我已经在我的主布局文件中导入了CSS,我在我的网站的所有页面中都使用了这个文件。谢谢这个标记,就是在那里我犯了这个错误,在我的代码中是正确的!别忘了主布局是布局你的文件夹名称?它是布局!