jeudi 24 octobre 2019

How to extend views with shared Layout in Laravel?

I have a collection of views that i want them to share a specific layout.

I created the layout master.blade.php ,in a folder i named it layouts.

From the docs , i found that i need to add the tag @extends and section('content') in my view so it fits under the layout :

@extends('layouts.master')
@section('content')

<div style="background-color:white;width:963px;height:100%">
    <div style="padding-top:100px;padding-bottom:200px">
        <h2 style="color:sandybrown; text-align:center"><b style="padding-right:40px">Contactez nous</b></h2>
        <br />
        <hr width="50%" color="gris" />
        <div class="row">
            <div class="col-md-6" style="padding:5%">
                <form method="post"  asp-controller="Home" asp-action="RegisterContact" style="padding-left:20px">
                    <label><span style="color:blue">Nom et prenom</span></label>
                    <br />
                    <input size=" 40" style="border-color:darkorange" asp-for="Name"/>
                    <br />


                    <label><span style="color:blue">E-mail</span></label>
                    <br />
                    <input size=" 40" asp-for="Email" style="border-color:darkorange" />
                    <br />
                    <label><span style="color:blue">Message</span></label>
                    <br />
                    <textarea rows="10" cols="40" style="border-color:darkorange"  asp-for="Message"></textarea>
                    <br />
                    <button style="background-color:blue;"><span style="color:white">ENVOYER</span></button>
                ....
@endsection

but when i click in the link in the view's link in the navbar , this is what i get ?:

enter image description here so is there a missing part in the logic ?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire