Example #1
0
 public function actionAll()
 {
     $article = new ResourceModel();
     $article->name = 'fukuro';
     $article->description = 'Lorem ipsum dolor sit amet';
     $article->insert();
     /* echo 'actionAll';
             $items = Resource::getAll();
             $show = new Show();
             $show->assign('items', $items);
             $show->items = $items;
             $show->display('resource/all.php');
     
            include __DIR__.'/../views/resource/all.php';*/
 }
 function ResourceCourse($prefix = FALSE, $dbconn = NULL)
 {
     $this->setResourceCode("course");
     parent::ResourceModel($prefix, $dbconn);
 }
Example #3
0
 public function getAllResources()
 {
     $_modelResource = new ResourceModel();
     try {
         $resourcesDb = $_modelResource->fetchAll()->toArray();
         //            $resources = array();
         //            foreach($resourcesDb as $resource){
         //                $resources[] = $resource['resource'];
         //            }
         return $resourcesDb;
     } catch (Exception $e) {
         throw $e;
     }
 }
Example #4
0
require_once __DIR__ . '/../app/models/ResourceModel.class.php';
require_once __DIR__ . '/../app/controllers/ResourcesController.class.php';
require_once __DIR__ . '/../app/models/BuildingModel.class.php';
require_once __DIR__ . '/../app/controllers/BuildingsController.class.php';
require_once __DIR__ . '/../app/models/LanternModel.class.php';
require_once __DIR__ . '/../app/controllers/LanternsController.class.php';
require_once __DIR__ . '/../app/models/GiftModel.class.php';
require_once __DIR__ . '/../app/controllers/GiftsController.class.php';
$basePath = '/v1';
$UsersController = new UsersController();
$ResourcesController = new ResourcesController();
$BuildingsController = new BuildingsController();
$LanternsController = new LanternsController();
$GiftsController = new GiftsController();
$UserModel = new UserModel();
$ResourceModel = new ResourceModel();
$BuildingModel = new BuildingModel();
$LanternModel = new LanternModel();
$GiftModel = new GiftModel();
/*
 * Main path
 */
$app->get('/', function (Request $request) use($app, $UsersController) {
    return $app->redirect('doc/index.html');
});
/*
 * Users
 */
$app->get($basePath . '/userInfos', function (Request $request) use($app, $UsersController, $UserModel) {
    $params = $request->query->all();
    $errorMessage = $UserModel->validate($params, "index");
 function ResourceUser($prefix = FALSE, $dbconn = NULL)
 {
     $this->setResourceCode("user");
     parent::ResourceModel($prefix, $dbconn);
 }
 function ResourceClassroom($prefix = FALSE, $dbconn = NULL)
 {
     $this->setResourceCode("classroom");
     parent::ResourceModel($prefix, $dbconn);
 }