I'm new to Laravel 4. I don't seem to find adequate documentation on the Blade templating system.
I see some examples at http://laravel.com/docs/templates with no explanation.
Another example at Laravel 4 Controller Templating / Blade - Correct method?
Where are @section, @yield, @show, etc defined and documented? Where is the Blade templating system actually explained?
Or is it so new, or so "intuitive", that it needs no explanation? Or I could use another templating system that is better documented?
Blade is the simple, yet powerful templating engine that is included with Laravel. Unlike some PHP templating engines, Blade does not restrict you from using plain PHP code in your templates.
You could download the class and start using it, or you could install via composer. It's 100% compatible without the Laravel's own features (extensions).
In Laravel, @yield is principally used to define a section in a layout and is constantly used to get content from a child page unto a master page.
@include is just like a basic PHP include, it includes a "partial" view into your view. @extends lets you "extend" a template, which defines its own sections etc. A template that you can extend will define its own sections using @yield , which you can then put your own stuff into in your view file.
I would say Blade is so easy that it doesn’t need documentation.
Follow this link great tutorial by Jeffrey Way which will take you through everything you need to know.
https://tutsplus.com/lesson/templating-changes/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With