adding css and js file in laravel 5.3

前端 未结 4 1020
萌比男神i
萌比男神i 2021-02-14 10:06

I want to include a css all css and js in single page and load it in all page.Now If I want to include bootstrap.css and bootstrap.js in welcome page I have included in welcome

4条回答
  •  后悔当初
    2021-02-14 10:56

    Define a common layout and include all .js and .css file on that layout and than bind your page with this layout.

    Layout:

    
        
            App Name - @yield('title')
        
        
            @section('sidebar')
                This is the master sidebar.
            @show
    
            
    @yield('content')

    Where: @yield directive is used to display the contents of a given section.

    View:

    @extends('layouts.default')
    @section('content')
        i am the home page
    @endsection
    

提交回复
热议问题