MCQs > Website Designing & Development > Laravel Framework > Which is correct to pass $name variable to views?

Laravel Framework MCQs

Which of the following is correct to pass $name variable to views?

Answer

Correct Answer: public function index() { $name = 'Foo'; return view('welcome', compact('name')); }

Explanation:

Note: This question has more than 1 correct answers

Note: This Question is unanswered, help us to find answer for this one

Laravel Framework Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it

search

Laravel Framework Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it