class TwigExtensionBase in Bamboo Twig 8.4
Same name and namespace in other branches
- 8.5 src/TwigExtension/TwigExtensionBase.php \Drupal\bamboo_twig\TwigExtension\TwigExtensionBase
- 8.2 src/TwigExtension/TwigExtensionBase.php \Drupal\bamboo_twig\TwigExtension\TwigExtensionBase
- 8.3 src/TwigExtension/TwigExtensionBase.php \Drupal\bamboo_twig\TwigExtension\TwigExtensionBase
Provides a Twig Extension Lazy Service Injection.
Hierarchy
- class \Drupal\bamboo_twig\TwigExtension\TwigExtensionBase extends \Drupal\bamboo_twig\TwigExtension\Twig_Extension uses \Symfony\Component\DependencyInjection\ContainerAwareTrait
Expanded class hierarchy of TwigExtensionBase
7 files declare their use of TwigExtensionBase
- Config.php in bamboo_twig_config/
src/ TwigExtension/ Config.php - File.php in bamboo_twig_file/
src/ TwigExtension/ File.php - I18n.php in bamboo_twig_i18n/
src/ TwigExtension/ I18n.php - Loader.php in bamboo_twig_loader/
src/ TwigExtension/ Loader.php - Render.php in bamboo_twig_loader/
src/ TwigExtension/ Render.php
1 string reference to 'TwigExtensionBase'
1 service uses TwigExtensionBase
File
- src/
TwigExtension/ TwigExtensionBase.php, line 11
Namespace
Drupal\bamboo_twig\TwigExtensionView source
class TwigExtensionBase extends \Twig_Extension {
use ContainerAwareTrait;
/**
* Unique identifier for this Twig extension.
*/
public function getName() {
return 'bamboo_twig.twig.base';
}
/**
* Lazy loading for the Drupal entity type manager.
*
* @return \Drupal\Core\Entity\EntityTypeManagerInterface
* Return the Drupal entity type manager.
*/
protected function getEntityTypeManager() {
return $this->container
->get('entity_type.manager');
}
/**
* Lazy loading for the Drupal entity repository.
*
* @return \Drupal\Core\Entity\EntityRepositoryInterface
* Return the Drupal entity repository.
*/
protected function getEntityRepository() {
return $this->container
->get('entity.repository');
}
/**
* Return the current route match.
*
* @return \Drupal\Core\Routing\RouteMatchInterface
* Return the current route match.
*/
protected function getCurrentRouteMatch() {
return $this->container
->get('current_route_match');
}
/**
* Manages discovery and instantiation of block plugins.
*
* @return \Drupal\Core\Block\BlockManagerInterface
* Return the block manager.
*/
protected function getPluginManagerBlock() {
return $this->container
->get('plugin.manager.block');
}
/**
* Provides an interface for form building and processing.
*
* @return \Drupal\Core\Form\FormBuilderInterface
* Return the interface for form building and processing.
*/
protected function getFormBuilder() {
return $this->container
->get('form_builder');
}
/**
* Interface for loading, transforming and rendering menu link trees.
*
* @return \Drupal\Core\Menu\MenuLinkTreeInterface
* Return the interface for loading, transforming and rendering menu link.
*/
protected function getMenuLinkTree() {
return $this->container
->get('menu.link_tree');
}
/**
* Read only settings singleton.
*
* @return \Drupal\Core\Site\Settings
* Return The settings object.
*/
protected function getSettingsSingleton() {
return $this->container
->get('settings');
}
/**
* Provides an interface for a configuration object factory.
*
* @return \Drupal\Core\Config\ConfigFactoryInterface
* Return the interface for a configuration object factory.
*/
protected function getConfigFactory() {
return $this->container
->get('config.factory');
}
/**
* The state storage service.
*
* @return \\Drupal\Core\State\StateInterface
* Return the state storage service.
*/
protected function getStateFactory() {
return $this->container
->get('state');
}
/**
* Lazy loading for the Drupal current user account proxy.
*
* @return \Drupal\Core\Session\AccountInterface
* Return The current user account proxy.
*/
protected function getCurrentUser() {
return $this->container
->get('current_user');
}
/**
* Return the user storage.
*
* @return \Drupal\user\UserStorageInterface
* Return the user storage.
*/
protected function getUserStorage() {
return $this
->getEntityTypeManager()
->getStorage('user');
}
/**
* Return the block storage.
*
* @return \Drupal\user\UserStorageInterface
* Return the block storage.
*/
protected function getBlockStorage() {
return $this
->getEntityTypeManager()
->getStorage('block');
}
/**
* Return the file storage.
*
* @return \Drupal\Component\PhpStorage\FileStorage
* Return the file storage.
*/
protected function getFileStorage() {
return $this
->getEntityTypeManager()
->getStorage('file');
}
/**
* Provides an interface defining an image style.
*
* @return \Drupal\image\ImageStyleInterface
* Return interface for image style.
*/
protected function getImageStyleStorage() {
return $this
->getEntityTypeManager()
->getStorage('image_style');
}
/**
* Return the factory for image objects.
*
* @return \Drupal\Core\Image\ImageFactory
* Return the factory for image objects.
*/
protected function getImageFactory() {
return $this->container
->get('image.factory');
}
/**
* Return the factory for image objects.
*
* @return \Drupal\Core\Field\FieldTypePluginManager
* Return the factory for image objects.
*/
protected function getFieldTypeManager() {
return $this->container
->get('plugin.manager.field.field_type');
}
/**
* Return the token service.
*
* @return \Drupal\Core\Utility\Token
* Return the token service.
*/
protected function getToken() {
return $this->container
->get('token');
}
/**
* Return a singleton mime type to file extension guesser.
*
* @return \Symfony\Component\HttpFoundation\File\MimeType\ExtensionGuesserInterface
* Return a singleton mime type to file extension guesser.
*/
protected function getExtensionGuesser() {
return ExtensionGuesser::getInstance();
}
/**
* Provides a service to handle various date related functionality.
*
* @var \Drupal\Core\Datetime\DateFormatterInterface
*/
protected function getDateFormatter() {
return $this->container
->get('date.formatter');
}
/**
* Returns the language manager service.
*
* @var \Drupal\Core\Language\LanguageManagerInterface
*/
protected function getLanguageManager() {
return $this->container
->get('language_manager');
}
/**
* Provides helpers to operate on files and stream wrappers.
*
* @var Drupal\Core\File\FileSystemInterface
* Return the File System object.
*/
protected function getFileSystemObject() {
return $this->container
->get('file_system');
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
TwigExtensionBase:: |
protected | function | Return the block storage. | |
TwigExtensionBase:: |
protected | function | Provides an interface for a configuration object factory. | |
TwigExtensionBase:: |
protected | function | Return the current route match. | |
TwigExtensionBase:: |
protected | function | Lazy loading for the Drupal current user account proxy. | |
TwigExtensionBase:: |
protected | function | Provides a service to handle various date related functionality. | |
TwigExtensionBase:: |
protected | function | Lazy loading for the Drupal entity repository. | |
TwigExtensionBase:: |
protected | function | Lazy loading for the Drupal entity type manager. | |
TwigExtensionBase:: |
protected | function | Return a singleton mime type to file extension guesser. | |
TwigExtensionBase:: |
protected | function | Return the factory for image objects. | |
TwigExtensionBase:: |
protected | function | Return the file storage. | |
TwigExtensionBase:: |
protected | function | Provides helpers to operate on files and stream wrappers. | |
TwigExtensionBase:: |
protected | function | Provides an interface for form building and processing. | |
TwigExtensionBase:: |
protected | function | Return the factory for image objects. | |
TwigExtensionBase:: |
protected | function | Provides an interface defining an image style. | |
TwigExtensionBase:: |
protected | function | Returns the language manager service. | |
TwigExtensionBase:: |
protected | function | Interface for loading, transforming and rendering menu link trees. | |
TwigExtensionBase:: |
public | function | Unique identifier for this Twig extension. | 7 |
TwigExtensionBase:: |
protected | function | Manages discovery and instantiation of block plugins. | |
TwigExtensionBase:: |
protected | function | Read only settings singleton. | |
TwigExtensionBase:: |
protected | function | The state storage service. | |
TwigExtensionBase:: |
protected | function | Return the token service. | |
TwigExtensionBase:: |
protected | function | Return the user storage. |