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
@ If (Auth: guest () @ else
- {Auth: user ()-> name }}
@ Endif
@ Yield ('content ')