public function url($uri = '', $module = null)
    {
        if ($module != null) {
            $appNames = Container::get('config')->get('app_name');
            if (is_array($appNames)) {
                foreach ($appNames as &$appName) {
                    $appName = str_replace('./', '', $appName);
                }

                $appNames = array_flip($appNames);
                $baseUrl = $appNames[$module];
                $baseUrl = '//' . $baseUrl . '/';
            }
        } else {
            $baseUrl = Container::get('request')->getBaseUrl();
        }

        $uri = is_array($uri) ? implode('/', $uri) : trim($uri, '/');
        $prefix = $baseUrl . 'index.php?_i=';

        switch (strtolower(Container::get('config')->get('url_mode'))) {
            case 'path_info':
                return $uri == '' ? rtrim($baseUrl, '/') : $baseUrl . $uri;
            case 'query_string':
                return $uri == '' ? rtrim($baseUrl, '/') : $prefix . $uri;
            default:
                throw new ConfigException('`url_mode` Config ERROR');
        }
    }
public function url($uri = '', $module = null)
    {
        if ($module != null) {
            $appNames = Container::get('config')->get('app_name');
            if (is_array($appNames)) {
                foreach ($appNames as &$appName) {
                    $appName = str_replace('./', '', $appName);
                }

                $appNames = array_flip($appNames);
                $baseUrl = $appNames[$module];
                $baseUrl = '//' . $baseUrl . '/';
            }
        } else {
            $baseUrl = Container::get('request')->getBaseUrl();
        }

        $uri = is_array($uri) ? implode('/', $uri) : trim($uri, '/');
        $prefix = $baseUrl . 'index.php?_i=';

        switch (strtolower(Container::get('config')->get('url_mode'))) {
            case 'path_info':
                return $uri == '' ? rtrim($baseUrl, '/') : $baseUrl . $uri;
            case 'query_string':
                return $uri == '' ? rtrim($baseUrl, '/') : $prefix . $uri;
            default:
                throw new ConfigException('`url_mode` Config ERROR');
        }
    }
public function url ( $ uri = '' , $ module = null ) { if ( $ module != null ) { $ appNames = Container :: get ( 'config' ) -> get ( 'app_name' ) ; if ( is_array ( $ appNames ) ) { foreach ( $ appNames as & $ appName ) { $ appName = str_replace ( './' , '' , $ appName ) ; } $ appNames = array_flip ( $ appNames ) ; $ baseUrl = $ appNames [ $ module ] ; $ baseUrl = '//' . $ baseUrl . '/' ; } } else { $ baseUrl = Container :: get ( 'request' ) -> getBaseUrl ( ) ; } $ uri = is_array ( $ uri ) ? implode ( '/' , $ uri ) : trim ( $ uri , '/' ) ; $ prefix = $ baseUrl . 'index.php?_i=' ; switch ( strtolower ( Container :: get ( 'config' ) -> get ( 'url_mode' ) ) ) { case 'path_info' : return $ uri == '' ? rtrim ( $ baseUrl , '/' ) : $ baseUrl . $ uri ; case 'query_string' : return $ uri == '' ? rtrim ( $ baseUrl , '/' ) : $ prefix . $ uri ; default : throw new ConfigException ( '`url_mode` Config ERROR' ) ; } }
Build Full URL

@param  string $uri
@param  string $module
@return string

@throws \Kotori\Exception\ConfigException
Build Full URL