Laravel5 student score management system-02-Blade Template

Source: Internet
Author: User
Tags php template
Laravel5 student score management system-02-Blade template Blade is a simple and powerful template engine provided by Laravel. Compared with other well-known PHP template engines, Blade does not limit that you must use PHP code in the view. All Blade views are compiled and cached into common PHP code until they are changed. This means that Blade will not generate a burden on your application. The Blade view file uses. blade. php as the extension and is usually stored in the resources/views folder.

# Define page layout

The two main advantages of using the Blade template are template inheritance and block. Let's start with a simple example. First, we need to confirm the "main" page layout. Most web applications maintain the same layout mode on different pages. this layout can be easily defined in this single Blade view:

We first construct a basic page template, because each page after it needs to inherit. create the master. blade. php file.

      
     
     
     
     @ Yield ('title ')    
 
     
  

Toggle Navigation@ If (Auth: guest () student score Management @ else @ if (Auth: user ()-> is_admin) student score Management @ else student score Management @ endif

  • Power by laravel5
    @ If (Auth: guest () @ else
  • {Auth: user ()-> name }}
    • Exit
  • @ Endif

@ Yield ('content ')

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.