Answer the question
In order to leave comments, you need to log in
Laravel. template system?
Greetings.
I decided to tinker with Laravel 4, but didn't figure out how to work with templates.
How it is done in Yii2:
In the layout we write <?=$content;?>
In the template, what we want to display.
In Laravel4:
In layout we write: @yield('content')
In the template:
@extends('layouts.default')
@section('content')
Контент
@stop
Answer the question
In order to leave comments, you need to log in
I think you should do one very useful thing - read the documentation.
In general, this is called "template inheritance". In Yii, a crutch with layouts. That is, unlike Yii, you can have infinite nesting and you can redefine blocks at each level. This allows you to reduce duplication in templates to the maximum. Templates are compiled so there are no performance problems either.
There are only 3 lines, where is it easier? But you can create several sections
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question