Views are responsible for the presentation layer of your application. They contain HTML (and minimal PHP) and display data passed from controllers.
Handles UI/output
Contains HTML, CSS, and minimal PHP
Does not contain business logic
Loaded by controllers
Create a file:
profile.php)
✔ esc() prevents XSS attacks.
Load helpers:
Use:
✅ Keep logic minimal
✅ Use layouts & sections
✅ Escape output with esc()
❌ Avoid database queries in views
Views handle presentation
Stored in app/Views
Data passed from controllers
Support layouts, sections, and helpers
Take quizzes related to this topic and see where you stand!
Start Quiz Now