abstract class StyleBase in Styles API 8
Provides a base class for Styles plugins.
Hierarchy
- class \Drupal\Component\Plugin\PluginBase implements DerivativeInspectionInterface, PluginInspectionInterface
- class \Drupal\Core\Plugin\PluginBase uses DependencySerializationTrait, MessengerTrait, StringTranslationTrait
- class \Drupal\styles_api\Plugin\Style\StyleBase implements StyleInterface
- class \Drupal\Core\Plugin\PluginBase uses DependencySerializationTrait, MessengerTrait, StringTranslationTrait
Expanded class hierarchy of StyleBase
File
- src/
Plugin/ Style/ StyleBase.php, line 17 - Contains \Drupal\styles_api\Plugin\Layout\StyleBase.
Namespace
Drupal\styles_api\Plugin\StyleView source
abstract class StyleBase extends PluginBase implements StyleInterface {
/**
* @var array
* The style configuration.
*/
protected $configuration = [];
/**
* Get the plugin's description.
*
* @return string
* The style description
*/
public function getDescription() {
return $this->pluginDefinition['description'];
}
/**
* Get the base path for all resources.
*
* @return string
* The full base to all resources.
*/
public function getLabel() {
return isset($this->pluginDefinition['label']) && $this->pluginDefinition['label'] ? $this->pluginDefinition['label'] : FALSE;
}
/**
* Get the full path to the icon image.
*
* This can optionally be used in the user interface to show the layout of
* regions visually.
*
* @return string
* The full path to preview image file.
*/
public function getIconFilename() {
return isset($this->pluginDefinition['icon']) && $this->pluginDefinition['icon'] ? $this->pluginDefinition['icon'] : FALSE;
}
/**
* Get the configuration for theme template.
*
* @return string
* Theme function name.
*/
public function getConfiguration() {
return isset($this->pluginDefinition['configuration']) && $this->pluginDefinition['configuration'] ? $this->pluginDefinition['configuration'] : FALSE;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ConfigurablePluginInterface:: |
public | function | Gets default configuration for this plugin. | 1 |
ConfigurablePluginInterface:: |
public | function | Sets the configuration for this plugin instance. | 1 |
DependencySerializationTrait:: |
protected | property | An array of entity type IDs keyed by the property name of their storages. | |
DependencySerializationTrait:: |
protected | property | An array of service IDs keyed by property name used for serialization. | |
DependencySerializationTrait:: |
public | function | 1 | |
DependencySerializationTrait:: |
public | function | 2 | |
DependentPluginInterface:: |
public | function | Calculates dependencies for the configured plugin. | 19 |
MessengerTrait:: |
protected | property | The messenger. | 29 |
MessengerTrait:: |
public | function | Gets the messenger. | 29 |
MessengerTrait:: |
public | function | Sets the messenger. | |
PluginBase:: |
protected | property | The plugin implementation definition. | 1 |
PluginBase:: |
protected | property | The plugin_id. | |
PluginBase:: |
constant | A string which is used to separate base plugin IDs from the derivative ID. | ||
PluginBase:: |
public | function |
Gets the base_plugin_id of the plugin instance. Overrides DerivativeInspectionInterface:: |
|
PluginBase:: |
public | function |
Gets the derivative_id of the plugin instance. Overrides DerivativeInspectionInterface:: |
|
PluginBase:: |
public | function |
Gets the definition of the plugin implementation. Overrides PluginInspectionInterface:: |
3 |
PluginBase:: |
public | function |
Gets the plugin_id of the plugin instance. Overrides PluginInspectionInterface:: |
|
PluginBase:: |
public | function | Determines if the plugin is configurable. | |
PluginBase:: |
public | function | Constructs a \Drupal\Component\Plugin\PluginBase object. | 92 |
PluginFormInterface:: |
public | function | Form constructor. | 36 |
PluginFormInterface:: |
public | function | Form submission handler. | 32 |
PluginFormInterface:: |
public | function | Form validation handler. | 18 |
StringTranslationTrait:: |
protected | property | The string translation service. | 1 |
StringTranslationTrait:: |
protected | function | Formats a string containing a count of items. | |
StringTranslationTrait:: |
protected | function | Returns the number of plurals supported by a given language. | |
StringTranslationTrait:: |
protected | function | Gets the string translation service. | |
StringTranslationTrait:: |
public | function | Sets the string translation service to use. | 2 |
StringTranslationTrait:: |
protected | function | Translates a string to the current language or to a given language. | |
StyleBase:: |
protected | property |
The style configuration. Overrides PluginBase:: |
|
StyleBase:: |
public | function |
Get the configuration for theme template. Overrides ConfigurablePluginInterface:: |
|
StyleBase:: |
public | function | Get the plugin's description. | |
StyleBase:: |
public | function | Get the full path to the icon image. | |
StyleBase:: |
public | function | Get the base path for all resources. |