Unit3 - Subjective Questions

INT221 • Practice Questions with Detailed Answers

1

Define a Controller in MVC programming and explain how to create a basic controller using Artisan commands.

2

Explain the concept of Controller Routing with a syntax example. How does it differ from closure-based routing?

3

What are Restful Resource Controllers? List the default actions generated by a resource controller.

4

Discuss how Middleware can be assigned within a Controller. Provide an example.

5

What is Blade in the context of PHP MVC frameworks? Explain how to display PHP Output using Blade syntax.

6

Explain the usage of Control Structures in Blade templates with examples for Conditional Statements and Loops.

7

Describe Template Inheritance in Blade. How do @extends, @section, and @yield work together?

8

What are Named Routes? Explain their benefits and provide a syntax example.

9

Explain Route Groups and how they help in organizing routes. Give examples of grouping by Middleware and Prefix.

10

What are Parameter Constraints in routing? How can you enforce constraints using Regular Expressions?

11

Explain Domain Routing. How can you route requests based on subdomains?

12

How does the framework handle URL Generation? Explain the helpers for generating the Current URL.

13

Differentiate between Generating Framework URLs and Asset URLs with examples.

14

What are Secure Routes? How can you generate URLs that force HTTPS?

15

Explain the concept of Controller Structures. How do Single Action Controllers (Invokable) differ from standard controllers?

16

How are Generation Shortcuts used in URL Generation? Give an example involving Controller Actions.

17

Describe how to pass data from a Controller to a View using Blade Templates.

18

Write a comprehensive note on Route Prefixing and Route Name Prefixing.

19

How does Blade handle Raw PHP? Why might a developer need to use the @php directive?

20

Derive the logic flow of a request in an MVC application utilizing Controller, Routing, and Blade components.