
Blade Templates
Blade syntax, directives, layouts, components, slots, includes, conditional rendering, loops
1Which Blade syntax displays a variable while automatically escaping HTML characters to prevent XSS vulnerabilities?
Which Blade syntax displays a variable while automatically escaping HTML characters to prevent XSS vulnerabilities?
Câu trả lời
The syntax {{ $variable }} automatically escapes HTML characters using htmlspecialchars, protecting against XSS attacks. Always use {{ }} by default to display user data, unless you explicitly need to display unescaped HTML with {!! !!}.
2What is the main difference between {{ $html }} and {!! $html !!}?
What is the main difference between {{ $html }} and {!! $html !!}?
Câu trả lời
{{ $html }} automatically escapes HTML characters to prevent XSS injections, while {!! $html !!} displays raw content without escaping. Use {!! !!} only to display trusted HTML, such as internally generated or validated content. Never display user data with {!! !!}.
3How to inherit from a parent layout in a child Blade template?
How to inherit from a parent layout in a child Blade template?
Câu trả lời
The @extends('layouts.app') directive allows a child template to inherit from a parent layout. It must be the first line of the Blade file. Then use @section to define content for sections declared with @yield in the parent layout.
Which Blade directive defines a placeholder in a parent layout that will be filled by child templates?
How to include a partial Blade file in a template?
+15 câu hỏi phỏng vấn
Các chủ đề phỏng vấn Laravel khác
PHP Basics
PHP OOP Essentials
Composer & Autoloading
Laravel Fundamentals
Laravel Routing
Request & Response
Eloquent ORM Basics
Eloquent Relationships
Migrations & Schema Builder
Validation & Forms
Authentication
Authorization & Policies
API Resources & Authentication
Middleware
Service Container & DI
Queues & Jobs
Events & Listeners
Notifications & Mail
File Storage
Testing & PHPUnit
Caching
Livewire & Inertia
Eloquent Advanced
Repository Pattern
Laravel Packages
Performance Optimization
Security Best Practices
Laravel Octane
Laravel Distributed Systems
Observability & Monitoring
Deployment & DevOps
Nắm vững Laravel cho lần phỏng vấn tiếp theo
Truy cập tất cả câu hỏi, flashcards, bài kiểm tra kỹ thuật, bài tập code review và mô phỏng phỏng vấn.
Bắt đầu miễn phí