C
C
Combat72018-03-19 21:40:03
Laravel
Combat7, 2018-03-19 21:40:03

How to use blade templates correctly?

I have a template, it has a header, content and footer.
In the controller, I open the desired template (content) on a get request.
But all pages have the same header. how to transfer data to it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
PashaNedved, 2018-03-20
@PashaNedved

// layouts.app
<h1>{{ $title }}</h1>

// content.page
@extends('layouts.app', ['title' => 'Page Title'])

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question