src/BoomCMS/Support/Helpers.php
public static function assetURL(array $params)
    {
        if (isset($params['asset']) && is_object($params['asset'])) {
            $asset = $params['asset'];
            $params['asset'] = $params['asset']->getId();
        }

        if (!isset($params['action'])) {
            $params['action'] = 'view';
        }

        if (isset($params['height']) && !isset($params['width'])) {
            $params['width'] = 0;
        }

        $url = route('asset', $params);

        if (isset($asset)) {
            $url .= '?'.$asset->getLastModified()->getTimestamp();
        }

        return $url;
    }
public static function assetURL(array $params)
    {
        if (isset($params['asset']) && is_object($params['asset'])) {
            $asset = $params['asset'];
            $params['asset'] = $params['asset']->getId();
        }

        if (!isset($params['action'])) {
            $params['action'] = 'view';
        }

        if (isset($params['height']) && !isset($params['width'])) {
            $params['width'] = 0;
        }

        $url = route('asset', $params);

        if (isset($asset)) {
            $url .= '?'.$asset->getLastModified()->getTimestamp();
        }

        return $url;
    }
public static function assetURL ( array $ params ) { if ( isset ( $ params [ 'asset' ] ) && is_object ( $ params [ 'asset' ] ) ) { $ asset = $ params [ 'asset' ] ; $ params [ 'asset' ] = $ params [ 'asset' ] -> getId ( ) ; } if ( ! isset ( $ params [ 'action' ] ) ) { $ params [ 'action' ] = 'view' ; } if ( isset ( $ params [ 'height' ] ) && ! isset ( $ params [ 'width' ] ) ) { $ params [ 'width' ] = 0 ; } $ url = route ( 'asset' , $ params ) ; if ( isset ( $ asset ) ) { $ url .= '?' . $ asset -> getLastModified ( ) -> getTimestamp ( ) ; } return $ url ; }
Generate a URL to link to an asset.

@param array $params

@return string
Generate a URL to link to an asset .