Back to WebAssetManager class

Method isAssetActive

public bool
isAssetActive
(string $type, string $name)
Check whether the asset are enabled
Parameters
  • string $type The asset type, script or style
  • string $name The asset name
Returns
  • bool
Since
  • 4.0.0
-
  • \Joomla\CMS\WebAsset\Exception\UnknownAssetException When Asset cannot be found

Method isAssetActive - Source code

/**
 * Check whether the asset are enabled
 *
 * @param   string  $type  The asset type, script or style
 * @param   string  $name  The asset name
 *
 * @return  boolean
 *
 * @throws  UnknownAssetException  When Asset cannot be found
 *
 * @since  4.0.0
 */
public function isAssetActive(string $type, string $name) : bool
{
    return $this->getAssetState($type, $name) !== static::ASSET_STATE_INACTIVE;
}