public function FileDefinitionDiscovery::hasDefinition in Libraries API 8.3
Checks whether a library definition exists.
Parameters
string $id: The library ID.
Return value
bool TRUE if a library definition with the given ID exists; FALSE otherwise.
Overrides DefinitionDiscoveryInterface::hasDefinition
File
- src/
ExternalLibrary/ Definition/ FileDefinitionDiscovery.php, line 25
Class
- FileDefinitionDiscovery
- Provides a libraries definition discovery using PHP's native file functions.
Namespace
Drupal\libraries\ExternalLibrary\DefinitionCode
public function hasDefinition($id) {
return file_exists($this
->getFileUri($id));
}