Actions in MVC in PHP
Let's now add methods to our controller class.
In MVC terms, controller methods are called
actions.
Let's create, for example, two actions - show1
and show2, and in each action, we will output
something to the screen:
<?php
namespace Project\Controllers;
use \Core\Controller;
class PageController extends Controller
{
public function show1()
{
echo '1';
}
public function show2()
{
echo '2';
}
}
?>