class DefaultTwigExtension in Opigno messaging 8
Class DefaultTwigExtension.
Hierarchy
- class \Drupal\opigno_messaging\TwigExtension\DefaultTwigExtension extends \Drupal\opigno_messaging\TwigExtension\Twig_Extension
Expanded class hierarchy of DefaultTwigExtension
1 string reference to 'DefaultTwigExtension'
1 service uses DefaultTwigExtension
File
- src/
TwigExtension/ DefaultTwigExtension.php, line 8
Namespace
Drupal\opigno_messaging\TwigExtensionView source
class DefaultTwigExtension extends \Twig_Extension {
/**
* {@inheritdoc}
*/
public function getTokenParsers() {
return [];
}
/**
* {@inheritdoc}
*/
public function getNodeVisitors() {
return [];
}
/**
* {@inheritdoc}
*/
public function getFilters() {
return [];
}
/**
* {@inheritdoc}
*/
public function getTests() {
return [];
}
/**
* {@inheritdoc}
*/
public function getFunctions() {
return [
new \Twig_SimpleFunction('get_unread_thread_count', [
$this,
'get_unread_thread_count',
]),
];
}
/**
* {@inheritdoc}
*/
public function getOperators() {
return [];
}
/**
* {@inheritdoc}
*/
public function getName() {
return 'opigno_messaging.twig.extension';
}
/**
* Returns unread thread count.
*/
public function get_unread_thread_count() {
return \Drupal::service('private_message.service')
->getUnreadThreadCount();
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
DefaultTwigExtension:: |
public | function | ||
DefaultTwigExtension:: |
public | function | ||
DefaultTwigExtension:: |
public | function | ||
DefaultTwigExtension:: |
public | function | ||
DefaultTwigExtension:: |
public | function | ||
DefaultTwigExtension:: |
public | function | ||
DefaultTwigExtension:: |
public | function | ||
DefaultTwigExtension:: |
public | function | Returns unread thread count. |