Todo:laravel using the Blade label Layout page
This article mainly introduces the use of Laravel label, unified Layout page. It is mainly used to label @yield,@ Stack, @extends, @section, @stop, @push. Streamline code, improve page download speed, performance, and content separation. From the developer's point of view, the Web page can be extracted from the same content to separate, so that each page code to display the theme content, concise, and less interference information.
1. Laravel's blade Tag code format is "named. blade.php", which is not very concise.
2. Create a unified layout style code template main.blade.php, using the HTML5 code structure, has the tag header,main,footer,35 line code to complete a style layout.
3. Create a new page a.blade.php, use this @extends to refer to the parent template main.blade.php,layouts is the path to the template.
4. From the two page code we can see Laravel Blade Basic use Method, in the sub-page definition @section definition code, in the master template use @yield, you can output the corresponding code, fully system Laravel concise elegance.
5. In main.blade.php we see the @stack, how to use this, as long as the a.blade.php created @push can be used, to do more expansion.
6. This is a simple label to use, and the unified page layout used, hoping to have an enlightening effect on you.
Wxgzh:ludong86
Todo:laravel using the Blade label Layout page