eimkasp

PHP Controller example

Aug 11th, 2016
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.54 KB | None | 0 0
  1. <?php
  2.  
  3. class OrdersController
  4. {
  5.     public function httpGetMethod(Http $http, array $queryFields)
  6.     {
  7.  
  8.         // Sukuriame modelio objekta
  9.         $ordersModel = new OrdersModel();
  10.  
  11.         /*
  12.          * Kreipiames i
  13.         modelio klases funkcija ir
  14.         priskiriame reiksmei
  15.         */
  16.         $orders = $ordersModel->listAll();
  17.  
  18.  
  19.         // Perduodame reiksmes i vei
  20.         return [
  21.             'orders' => $orders,
  22.         ];
  23.     }
  24.  
  25.     public function httpPostMethod(Http $http, array $queryFields)
  26.     {
  27.  
  28.     }
  29. }
Add Comment
Please, Sign In to add comment