Answer the question
In order to leave comments, you need to log in
How to connect 2 views into one layout in laravel?
Good day everyone
I started tinkering with laravel and its blade templating engine. The following question arose
How to connect 2 different views to one layout?
In both views I use @extend
Here is the layout
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>App Name</title>
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
<script src="https://unpkg.com/[email protected]/dist/vuex.js"></script>
{{-- <link rel="stylesheet" href={{ URL::asset('css/custom.css') }}>--}}
</head>
<body>
@yield('contentTwo')
<section class="content">
<div class="wraper container-fluid">
@yield('content')
</div>
</section>
</body>
<script src={{ asset('js/app.js') }}></script>
</html>
@extends('layouts.home')
@section('content')
ssssss
@endsection
@extends('layouts.home')
@section('contentTwo')
sss223231
@endsection
Answer the question
In order to leave comments, you need to log in
One twist. It can have any number of sections. If there are any in the parent templates, they will be displayed.
@extends('layouts.home')
@section('content')
ssssss
@endsection
@section('contentTwo')
sss223231
@endsection
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question