Todo:laravel using the Blade label Layout page

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.