PHP ရှိ MVC အတွက် Actions များ

ယခု ကျွန်ုပ်တို့၏ controller သို့ class method များကို ထည့်ပါမည်။ MVC အသုံးအနှုန်းများတွင် controller method များကို actions ဟုခေါ်သည်။ ဥပမာအနေဖြင့် actions နှစ်ခု - show1 နှင့် show2 ကိုပြုလုပ်ပြီး တစ်ခုစီတွင် အချို့အရာများကို စခရင်ပေါ်တွင် ပြပါမည်။

project/controllers/PageController.php<?php
  namespace Project\Controllers;
  use \Core\Controller;
  
  class PageController extends Controller
  {
    public function show1()
    {
      echo '1';
    }
    
    public function show2()
    {
      echo '2';
    }
  }
?>