PHP Class Webiny\Component\TemplateEngine\Plugin
This class is used by template engines to register plugins.
Based on the template engine a plugin can be a modifier, a tag, a filter or something else.
Afficher le fichier
Open project: Webiny/Framework
Class Usage Examples
Méthodes publiques
Method Details
__construct()
public méthode
public __construct ( string $name, string $type, Closure | string $callbackFunction, array $params = [] ) |
$name |
string |
Plugin Name of the plugin. |
$type |
string |
Plugin type. The type value depends on the current template engine driver.
They usually have values like "function", "tag", "modifier"..etc.
Basically they define the type of the plugin. |
$callbackFunction |
Closure | string |
Callback function that holds the plugin logic. |
$params |
array |
Optional parameters that can be passed to the plugin. |
getAttribute()
public méthode
Return the attribute value under the defined $key.
public getAttribute ( string $key, mixed $defaultValue = false ) : mixed |
$key |
string |
Attribute key. |
$defaultValue |
mixed |
Default value that the method should return if $key is not found among the attributes. |
Résultat |
mixed |
|
getCallbackFunction()
public méthode
Get the callable function.
getParams()
public méthode
setAttribute()
public méthode
Sets an optional attribute to the plugin.