Prado\TApplicationComponent::publishAsset PHP Метод

publishAsset() публичный Метод

This method will publish a private asset (file or directory) and gets the URL to the asset. Note, if the asset refers to a directory, all contents under that directory will be published. Also note, it is recommended that you supply a class name as the second parameter to the method (e.g. publishAsset($assetPath,__CLASS__) ). By doing so, you avoid the issue that child classes may not work properly because the asset path will be relative to the directory containing the child class file.
public publishAsset ( $assetPath, $className = null ) : string
Результат string URL to the asset path.
    public function publishAsset($assetPath, $className = null)
    {
        if ($className === null) {
            $className = get_class($this);
        }
        $class = new \ReflectionClass($className);
        $fullPath = dirname($class->getFileName()) . DIRECTORY_SEPARATOR . $assetPath;
        return $this->publishFilePath($fullPath);
    }