library/Phalex/Events/Listener/Application.php
private function setUrlService(Di $di, Config $config, $name)
    {
        $base   = $static = '/';
        if (isset($config['url'])) {
            $default = isset($config['url']['default']) ? $config['url']['default'] : '/';
            if (isset($config['url'][$name])) {
                $base   = isset($config['url'][$name]['uri']) ? $config['url'][$name]['uri'] : $default;
                $static = isset($config['url'][$name]['static']) ? $config['url'][$name]['static'] : $default;
            }
        }
        
        $url = new UrlService();
        $url->setBaseUri($base);
        $url->setStaticBaseUri($static);
        $di->set('url', $url, true);
        return $this;
    }
private function setUrlService(Di $di, Config $config, $name)
    {
        $base   = $static = '/';
        if (isset($config['url'])) {
            $default = isset($config['url']['default']) ? $config['url']['default'] : '/';
            if (isset($config['url'][$name])) {
                $base   = isset($config['url'][$name]['uri']) ? $config['url'][$name]['uri'] : $default;
                $static = isset($config['url'][$name]['static']) ? $config['url'][$name]['static'] : $default;
            }
        }
        
        $url = new UrlService();
        $url->setBaseUri($base);
        $url->setStaticBaseUri($static);
        $di->set('url', $url, true);
        return $this;
    }
private function setUrlService ( Di $ di , Config $ config , $ name ) { $ base = $ static = '/' ; if ( isset ( $ config [ 'url' ] ) ) { $ default = isset ( $ config [ 'url' ] [ 'default' ] ) ? $ config [ 'url' ] [ 'default' ] : '/' ; if ( isset ( $ config [ 'url' ] [ $ name ] ) ) { $ base = isset ( $ config [ 'url' ] [ $ name ] [ 'uri' ] ) ? $ config [ 'url' ] [ $ name ] [ 'uri' ] : $ default ; $ static = isset ( $ config [ 'url' ] [ $ name ] [ 'static' ] ) ? $ config [ 'url' ] [ $ name ] [ 'static' ] : $ default ; } } $ url = new UrlService ( ) ; $ url -> setBaseUri ( $ base ) ; $ url -> setStaticBaseUri ( $ static ) ; $ di -> set ( 'url' , $ url , true ) ; return $ this ; }
Set url service when module start
@param Di $di
@param Config $config
@param string $name Module name
@return \Phalex\Events\Listener\Application
Set url service when module start