Controller Actions
The methods in the controller class are called Actions. Actions are responsible for sending
appropriate response for browser/user making the request. View is rendered by the name
of action, i.e., the name of method in controller.
Example
class RecipesController extends AppController
{
public function view($id)
{
// Action logic goes here.
}
public function share($customerId, $recipeId)
{
// Action logic goes here.
}
public function search($query)
{
// Action logic goes here.
}
}
As you can see in the above example, the
Do'stlaringiz bilan baham: |