Example #1
1
 public function createExtensions()
 {
     $Extension = new Extension();
     $this->AdminUsers = $Extension->create(array('name' => 'Admin::Users', 'is_core' => true, 'is_enabled' => true));
     $this->AdminPermissions = $Extension->create(array('name' => 'Admin::Permissions', 'is_core' => true, 'is_enabled' => true));
     $this->AdminRoles = $Extension->create(array('name' => 'Admin::Roles', 'is_core' => true, 'is_enabled' => true));
     $this->AdminDashboard = $Extension->create(array('name' => 'Admin::Dashboard', 'is_core' => true, 'is_enabled' => true));
     $this->AdminMenuTabs = $Extension->create(array('name' => 'Admin Menu Tabs', 'is_core' => true, 'is_enabled' => true));
 }
Example #2
0
 public function api_save()
 {
     $data = true;
     $_POST['parent'] = $_POST['parent'] == 0 ? null : $_POST['parent'];
     if ($_POST['id'] == 'FIRST') {
         try {
             if (strlen($_POST['value']) > 2) {
                 $create = Extension::create(array('parent' => $_POST['parent'], 'value' => $_POST['value']));
             } else {
                 $data = false;
             }
         } catch (Exception $e) {
             //ERROR
             $data = false;
         }
     } else {
         try {
             $save = Extension::find_by_id($_POST['id']);
             $save->parent = $_POST['parent'];
             $save->value = $_POST['value'];
             $save->save();
         } catch (Exception $e) {
             //ERROR
             $data = false;
         }
     }
     echo (string) $data;
 }
Example #3
0
<?php

namespace PHPCrystal\RESTful\Facade;

return Extension::create()->setDirectory(__DIR__)->setComposerName('phpcrystal/restful-api')->setRouter('PHPCrystal\\RESTful\\Service\\Router\\Restful')->init();