Support the ongoing development of Laravel.io →
posted 7 years ago
Blade

Is there any way to use the @extend functionality but pass a string rather than a file that contains the layout?

I'm wanting to store the layouts in the database and can't figure out a good way to extend layouts w/o using a file.

I want it to do something like this:

@extends("<html><head></head><body>@yield('content')</body></html>")

@section('content')
 <p>Text here</p>

@endsection
Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

aheinzm aheinzm Joined 2 Jun 2014

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.