ox/router

Ox Router

This package's canonical repository appears to be gone and the package has been frozen as a result.

v1.6 2016-05-20 07:42 UTC

README

Current Build Status

Build Status Latest Stable Version Total Downloads Latest Unstable Version License

Router

    Router::addGroupMiddleware("clientLocal", array(
        "Auth" => array("status" => "client"),
        "Domain" => array("hostname" => "localhost"),
        ),
        array("ToJson"=>array())
     );

    Router::rout("/login")->app("login")->save();
    Router::rout("/get")->method("GET")->app("login")->save();

    Router::setMiddlewareGroup("clientLocal",function(){
          Router::rout("/")->app("index")->save();
          Router::rout("/order/:num=>id")->app("order")->save();
          Router::rout("/files/:img")->app("image")->save();
          Router::rout("/uploads/:img")->app("image")->middleware("Domain",array("hostname"=>"other.dev")->save();
    });

Controller:

DIR: OxApp/controllers

Namespace: \OxApp\controllers

NameController extends \Ox\App

Middleware:

DIR: OxApp/middleware

Namespace - \OxApp\middleware

public function rules($rule=array())