Support the ongoing development of Laravel.io →
Views Blade Architecture

Hi!

I'm starting my adventure with Laravel, and unfortunately I encounered a problem.

My app template is:

<!DOCTYPE html>
<html>
<head>
    ...
    <title>Title @yield('subtitle')</title>
</head>

<body>
@include('assets.topnav')

@yield('header')

@yield('content')

@include('assets.footer')

</body>
</html>

And my register view is:

@extends('app')

@section('subtitle')
    register
@stop

@section('content')
    content
@stop

What is the problem? When I visit register page I see some elements, which shouldn't be there (e.g. header section). But the real problem is, on the top of page there is "@extends('app') caption. This is the screen.

Sorry for this, but I'm just starting with learning laravel :)

Thanks, guys

Last updated 3 years ago.
0

Did you name your files with a blade extension?

For example app.blade.php and register.blade.php

0

Yes. My main template is app.blade.php and register view is register.blade.php. Here's another screen. It can be useful: http://oi57.tinypic.com/4h89yc.jpg

0

Hm...I would start by stripping things away and seeing what might be causing the problem. I copied and pasted what you posted, and it worked for me.

Try removing the assets temporarily and seeing if that makes it work. That way, you could isolate which part of the code is the culprit.

Also, regarding single-line sections like your subtitle, I would recommend doing something like this:

@section('subtitle', 'register')
0

Thanks. Little steps, debugging and there was my little mistake - a typo ;)

Last updated 9 years ago.
0

Sign in to participate in this thread!

PHPverse

Your banner here too?

c00perpl c00perpl Joined 3 May 2015

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.