0Pricing
PHP Academy · Lesson

Blade Templates and Views

Render dynamic HTML with Blade directives, layouts, and components.

What is Blade?

Blade is Laravel' templating engine. Files end in .blade.php and support directives, loops, and layout inheritance. Blade is compiled to plain PHP and cached.

Outputting Variables

Use double curly braces to output a variable. The value is automatically escaped to prevent XSS.

{{-- resources/views/greeting.blade.php --}}
<h1>Hello, {{ $name }}</h1>
<p>You have {{ $messageCount }} messages.</p>

All lessons in this course

  1. Laravel Project Structure
  2. Defining Routes in Laravel
  3. Controllers and Actions
  4. Blade Templates and Views
← Back to PHP Academy