Blade template skeleton
Rating:
Clone this SnippetSubmitted 6 years 8 months ago by peter.
- Log in to post comments
Blade template skeleton which shows inheritance
// location: views/master.blade.php <!DOCTYPE html> <html> <head> <meta charset="utf-8"> @section('meta_description') <meta name="description" content="My website snippet for search engine"> @show @section('meta_author') <meta name="author" content="Peter J Lord"> @show @section('title') <title>example.com</title> @show </head> <body> @section('content') I'm the default content @show </body> </html> <!-- Now for the child template which inherits the master template --> // location: views/child.blade.php @extends('master') @section('meta_description') <meta name="description" content="This will replace the master template description @section('meta_description') "> @show @section('meta_author') <meta name="author" content="Peter J Lord"> @show @section('title') <title>Page Title | example.com</title> @show @section('content') The content goes here @show
Category:
LaravelLaravel Category:
Blade