LARAVEL View MCQ
Laravel MCQ(1) The following method is used to share data among all views in laravel application.
A) main()
B) boot()
C) run()
D) init()
Explanation
Laravel also provide the facility to share data among all view, for this purpose we have to use boot method of service provider.
(2) Which of the following operator is used to access nested view files in laravel?
A) dot
B) *
C) @
D) $
Explanation
dot or slash operator is used to access nested child directories in laravel.
(3) Which of the follwing way allowed in laravel to return view files?
A) route
B) controller
C) model
D) All of these
Explanation
In laravel views can be rendered from all of these files.
(4) Which files are part of auth directory in Laravel?
A) login
B) register
C) reset password
D) All of these
Explanation
Laravel provide auth directory by default with the fresh application installation. This folder contains all required files for login and authentication.
(5) How many nesting of views directory is allowed in laravel?
A) One
B) Two
C) Three
D) Many
Explanation
There is no limit to nest directories in laravel. We can use separate directories for each independent modules.
(6) Which of the following is file extension of laravel views?
A) .html
B) .blade
C) .blade.php
D) .php
Explanation
Laravel use blade template engine, each view used/rendered in laravel application has .blad.php file extension.