Back to WebAssetManagerInterface class

Method getAssets

public \Joomla\CMS\WebAsset\WebAssetItemInterface[]
getAssets
(string $type, bool $sort = false)
Get all assets that was enabled for given type
Parameters
  • string $type Asset type, script or style etc
  • bool $sort Whether need to sort the assets to follow the dependency Graph
Returns
  • \Joomla\CMS\WebAsset\WebAssetItemInterface[]
Since
  • 4.0.0
-
  • \Joomla\CMS\WebAsset\Exception\UnknownAssetException When Asset cannot be found
  • \Joomla\CMS\WebAsset\Exception\UnsatisfiedDependencyException When Dependency cannot be found

Method getAssets - Source code

/**
 * Get all assets that was enabled for given type
 *
 * @param   string  $type  Asset type, script or style etc
 * @param   bool    $sort  Whether need to sort the assets to follow the dependency Graph
 *
 * @return  WebAssetItemInterface[]
 *
 * @throws  UnknownAssetException  When Asset cannot be found
 * @throws  UnsatisfiedDependencyException When Dependency cannot be found
 *
 * @since  4.0.0
 */
public function getAssets(string $type, bool $sort = false) : array;