concrete/src/Editor/Plugin.php
public function requireAsset($assetType, $assetHandle = false)
    {
        $list = AssetList::getInstance();
        if ($assetType instanceof AssetInterface) {
            $this->requiredAssetGroup->addAsset($assetType);
        } elseif ($assetType && $assetHandle) {
            $ap = new AssetPointer($assetType, $assetHandle);
            $this->requiredAssetGroup->add($ap);
        } else {
            $r = $list->getAssetGroup($assetType);
            if (isset($r)) {
                $this->requiredAssetGroup->addGroup($r);
            } else {
                throw new Exception(t('"%s" is not a valid asset group handle', $assetType));
            }
        }
    }
public function requireAsset($assetType, $assetHandle = false)
    {
        $list = AssetList::getInstance();
        if ($assetType instanceof AssetInterface) {
            $this->requiredAssetGroup->addAsset($assetType);
        } elseif ($assetType && $assetHandle) {
            $ap = new AssetPointer($assetType, $assetHandle);
            $this->requiredAssetGroup->add($ap);
        } else {
            $r = $list->getAssetGroup($assetType);
            if (isset($r)) {
                $this->requiredAssetGroup->addGroup($r);
            } else {
                throw new Exception(t('"%s" is not a valid asset group handle', $assetType));
            }
        }
    }
public function requireAsset ( $ assetType , $ assetHandle = false ) { $ list = AssetList :: getInstance ( ) ; if ( $ assetType instanceof AssetInterface ) { $ this -> requiredAssetGroup -> addAsset ( $ assetType ) ; } elseif ( $ assetType && $ assetHandle ) { $ ap = new AssetPointer ( $ assetType , $ assetHandle ) ; $ this -> requiredAssetGroup -> add ( $ ap ) ; } else { $ r = $ list -> getAssetGroup ( $ assetType ) ; if ( isset ( $ r ) ) { $ this -> requiredAssetGroup -> addGroup ( $ r ) ; } else { throw new Exception ( t ( '"%s" is not a valid asset group handle' , $ assetType ) ) ; } } }
Add an asset to the assets required for this plugin.

@param \Concrete\Core\Asset\AssetInterface|string $assetType The asset to require, or the asset group handle, or the asset type (in this case, specify the $assetHandle parameter)
@param string|null|false $assetHandle the handle of the asset to specify (if $assetType is the asset type handle)

@throws \Exception throws an Exception if the asset is not valid
Add an asset to the assets required for this plugin .