Controllers Action

Actions are defined in the controllers file. They need to be called while executing a request in an application through the URL.


# Creating Action

An action is created by defining a public method whose name starts with the word action.

Example:

Step 1 We'll create an action named index2 in the SampleController.php file.