public function register($method, $route, $mix = null, $view = null, $data = [])
    {
        if($mix == null && $view == null) {
            $mix = 'IndexController@index';
        }
        if(is_string($mix) && $mix !== null) {
            if(strpos($mix, '@') === false) {
                $mix = $mix.'@index';
            }
        }
        $route = trim($route, '/ ');
        $route = (self::$instance->prefix == null) ? $route : self::$instance->prefix.'/'.$route;
        $array = $route==='' ? [] : explode('/', $route);
        $size = count($array);
        $route = '/'.$route;
        if(strpos($route, '{') !== false) {
            $to = 0;
            $param = true;
            foreach($array as $i => $uriPiece) {
                $uriPiece = trim($uriPiece);
                if(strpos($uriPiece, '{') !== false) {
                    if(
                        strpos($uriPiece, '{') === 0 && 
                        strpos($uriPiece, '}') !== false && 
                        strpos($uriPiece, '}') === (strlen($uriPiece) - 1)
                    ) {
                        $args[$uriPiece] = rtrim(ltrim($uriPiece, '{'), '}');
                    }
                    else {
                        $args[$uriPiece] = null;
                    }
                }
                else {
                    $to = $i+1;
                    $args[$uriPiece] = null;
                }
            }
            $base_size = $to;
            $base_route = array_slice($array, 0, $to, true);
        }
        else {
            $param = false;
            $base_size = $size;
            $args = null;
            $base_route = $route;
        }
        $base_route = is_array($base_route) ? implode('/', $base_route) : $base_route;
        if(trim($base_route) === '') $base_route = '/';
        self::$instance->routes[] = [$method, $route, $mix, $view, $data, $args, $size, $base_size, $param];
    }
public function register($method, $route, $mix = null, $view = null, $data = [])
    {
        if($mix == null && $view == null) {
            $mix = 'IndexController@index';
        }
        if(is_string($mix) && $mix !== null) {
            if(strpos($mix, '@') === false) {
                $mix = $mix.'@index';
            }
        }
        $route = trim($route, '/ ');
        $route = (self::$instance->prefix == null) ? $route : self::$instance->prefix.'/'.$route;
        $array = $route==='' ? [] : explode('/', $route);
        $size = count($array);
        $route = '/'.$route;
        if(strpos($route, '{') !== false) {
            $to = 0;
            $param = true;
            foreach($array as $i => $uriPiece) {
                $uriPiece = trim($uriPiece);
                if(strpos($uriPiece, '{') !== false) {
                    if(
                        strpos($uriPiece, '{') === 0 && 
                        strpos($uriPiece, '}') !== false && 
                        strpos($uriPiece, '}') === (strlen($uriPiece) - 1)
                    ) {
                        $args[$uriPiece] = rtrim(ltrim($uriPiece, '{'), '}');
                    }
                    else {
                        $args[$uriPiece] = null;
                    }
                }
                else {
                    $to = $i+1;
                    $args[$uriPiece] = null;
                }
            }
            $base_size = $to;
            $base_route = array_slice($array, 0, $to, true);
        }
        else {
            $param = false;
            $base_size = $size;
            $args = null;
            $base_route = $route;
        }
        $base_route = is_array($base_route) ? implode('/', $base_route) : $base_route;
        if(trim($base_route) === '') $base_route = '/';
        self::$instance->routes[] = [$method, $route, $mix, $view, $data, $args, $size, $base_size, $param];
    }
public function register ( $ method , $ route , $ mix = null , $ view = null , $ data = [ ] ) { if ( $ mix == null && $ view == null ) { $ mix = 'IndexController@index' ; } if ( is_string ( $ mix ) && $ mix !== null ) { if ( strpos ( $ mix , '@' ) === false ) { $ mix = $ mix . '@index' ; } } $ route = trim ( $ route , '/ ' ) ; $ route = ( self :: $ instance -> prefix == null ) ? $ route : self :: $ instance -> prefix . '/' . $ route ; $ array = $ route === '' ? [ ] : explode ( '/' , $ route ) ; $ size = count ( $ array ) ; $ route = '/' . $ route ; if ( strpos ( $ route , '{' ) !== false ) { $ to = 0 ; $ param = true ; foreach ( $ array as $ i => $ uriPiece ) { $ uriPiece = trim ( $ uriPiece ) ; if ( strpos ( $ uriPiece , '{' ) !== false ) { if ( strpos ( $ uriPiece , '{' ) === 0 && strpos ( $ uriPiece , '}' ) !== false && strpos ( $ uriPiece , '}' ) === ( strlen ( $ uriPiece ) - 1 ) ) { $ args [ $ uriPiece ] = rtrim ( ltrim ( $ uriPiece , '{' ) , '}' ) ; } else { $ args [ $ uriPiece ] = null ; } } else { $ to = $ i + 1 ; $ args [ $ uriPiece ] = null ; } } $ base_size = $ to ; $ base_route = array_slice ( $ array , 0 , $ to , true ) ; } else { $ param = false ; $ base_size = $ size ; $ args = null ; $ base_route = $ route ; } $ base_route = is_array ( $ base_route ) ? implode ( '/' , $ base_route ) : $ base_route ; if ( trim ( $ base_route ) === '' ) $ base_route = '/' ; self :: $ instance -> routes [ ] = [ $ method , $ route , $ mix , $ view , $ data , $ args , $ size , $ base_size , $ param ] ; }
register a route.

@param  string                $route
@param  string|callback|null  $mix
@param  string|null           $view
@param  array                 $data
@return void
register a route .