Back to WebAssetManagerInterface class

Method useAsset

public self
useAsset
(string $type, string $name)
Enable an asset item to be attached to a Document
Parameters
  • string $type Asset type, script or style etc
  • string $name The asset name
Returns
  • self
Since
  • 4.0.0
-
  • \Joomla\CMS\WebAsset\Exception\UnknownAssetException When Asset cannot be found
  • \Joomla\CMS\WebAsset\Exception\InvalidActionException When the Manager already attached to a Document

Method useAsset - Source code

/**
 * Enable an asset item to be attached to a Document
 *
 * @param   string  $type  Asset type, script or style etc
 * @param   string  $name  The asset name
 *
 * @return self
 *
 * @throws  UnknownAssetException  When Asset cannot be found
 * @throws  InvalidActionException When the Manager already attached to a Document
 *
 * @since  4.0.0
 */
public function useAsset(string $type, string $name) : self;