Ejemplo n.º 1
0
 /**
  * Define the routes for the HookSample component
  *
  * @access protected
  * @param \Bytes\Router $Router
  * @return void
  */
 protected function CreateRoutes(\Bytes\Router &$Router)
 {
     /* ------------------------------------------------------------------------------------------------------
           ROUTES
        ------------------------------------------------------------------------------------------------------ */
     $Router->RequestType('GET')->CreateRoute('/^usehooks\\/?$/', 'Hooks', 'UseAHook');
 }
Ejemplo n.º 2
0
 protected function CreateRoutes(\Bytes\Router &$Router)
 {
     $Router->CreateRoute('/^sample\\/index\\/$/', 'Index', 'HelloWorld');
     $Router->CreateRoute('/^sample\\/string\\/$/', 'Index', 'ReturnString');
     $Router->CreateRoute('/^sample\\/env\\/$/', 'Index', 'Env');
     $Router->HandleErrorsWith('Custom')->CreateRoute('/^sample\\/error\\/$/', 'Index', 'InvokeError');
 }
Ejemplo n.º 3
0
 protected function CreateRoutes(\Bytes\Router &$Router)
 {
     $Router->CreateRoute(new ErrorHandle('JSON'), 'Index', 'JSONError');
 }
Ejemplo n.º 4
0
 protected function CreateRoutes(\Bytes\Router &$Router)
 {
     $Router->CreateRoute('/^\\/?$/', 'Index', 'HelloWorld');
     $Router->CreateRoute('/^hmvc\\/?$/', 'Index', 'HMVC');
     $Router->CreateRoute('/^install\\/?$/', 'Index', 'Install');
     $Router->RequestType('GET')->CreateRoute('/^ajax\\/?$/', 'Index', 'AjaxGET');
     $Router->RequestType('POST')->CreateRoute('/^ajax\\/?$/', 'Index', 'AjaxPOST');
     $Router->RequestType('PATCH')->CreateRoute('/^ajax\\/?$/', 'Index', 'AjaxPATCH');
     $Router->RequestType('PUT')->CreateRoute('/^ajax\\/?$/', 'Index', 'AjaxPUT');
     $Router->RequestType('DELETE')->CreateRoute('/^ajax\\/?$/', 'Index', 'AjaxDELETE');
     $Router->RequestType('GET')->HandleErrorsWith('JSON')->CreateRoute('/^json\\-error\\/?$/', 'Index', 'JSONError');
     $Router->RequestType('GET')->HandleErrorsWith('')->CreateRoute('/^normal\\-error\\/?$/', 'Index', 'NormalError');
 }