public function getUrl($path, $plugin, $appendTime = true)
    {
        $pathParts = explode('/', $path);
        $isAssetPath = ($pathParts[0] === 'ASSETS');

        if ($isAssetPath) {
            $absPath = $this->_getBaseAssetPath($plugin) . join('/', array_slice($pathParts, 1));
        } else {
            $absPath = $this->_getBasePath($plugin) . $path;
        }

        $time = $appendTime ? $this->_getModifiedTime($absPath) : '';
        $pathPrefix = '';
        if ($plugin !== false) {
            $pluginParts = explode('/', $plugin);
            foreach ($pluginParts as $key => $part) {
                $pluginParts[$key] = Inflector::underscore($part);
            }
            $pathPrefix .= join('/', $pluginParts) . '/';
        } else {
            $pathPrefix = '';
        }
        $path = $pathPrefix . $path;

        $options = [
            'fullBase' => (bool)$this->getConfig('fullBase', false)
        ];

        return $this->Url->assetUrl($path, $options) . $time;
    }
public function getUrl($path, $plugin, $appendTime = true)
    {
        $pathParts = explode('/', $path);
        $isAssetPath = ($pathParts[0] === 'ASSETS');

        if ($isAssetPath) {
            $absPath = $this->_getBaseAssetPath($plugin) . join('/', array_slice($pathParts, 1));
        } else {
            $absPath = $this->_getBasePath($plugin) . $path;
        }

        $time = $appendTime ? $this->_getModifiedTime($absPath) : '';
        $pathPrefix = '';
        if ($plugin !== false) {
            $pluginParts = explode('/', $plugin);
            foreach ($pluginParts as $key => $part) {
                $pluginParts[$key] = Inflector::underscore($part);
            }
            $pathPrefix .= join('/', $pluginParts) . '/';
        } else {
            $pathPrefix = '';
        }
        $path = $pathPrefix . $path;

        $options = [
            'fullBase' => (bool)$this->getConfig('fullBase', false)
        ];

        return $this->Url->assetUrl($path, $options) . $time;
    }
public function getUrl ( $ path , $ plugin , $ appendTime = true ) { $ pathParts = explode ( '/' , $ path ) ; $ isAssetPath = ( $ pathParts [ 0 ] === 'ASSETS' ) ; if ( $ isAssetPath ) { $ absPath = $ this -> _getBaseAssetPath ( $ plugin ) . join ( '/' , array_slice ( $ pathParts , 1 ) ) ; } else { $ absPath = $ this -> _getBasePath ( $ plugin ) . $ path ; } $ time = $ appendTime ? $ this -> _getModifiedTime ( $ absPath ) : '' ; $ pathPrefix = '' ; if ( $ plugin !== false ) { $ pluginParts = explode ( '/' , $ plugin ) ; foreach ( $ pluginParts as $ key => $ part ) { $ pluginParts [ $ key ] = Inflector :: underscore ( $ part ) ; } $ pathPrefix .= join ( '/' , $ pluginParts ) . '/' ; } else { $ pathPrefix = '' ; } $ path = $ pathPrefix . $ path ; $ options = [ 'fullBase' => ( bool ) $ this -> getConfig ( 'fullBase' , false ) ] ; return $ this -> Url -> assetUrl ( $ path , $ options ) . $ time ; }
Get the asset url for a specific file.

@param string $path The path to the css file relative to the app or plugin webroot.
@param bool|string $plugin Either false or the name of a plugin.
@param bool $appendTime Whether to append a last modified timestamp to the url.
@return string
Get the asset url for a specific file .