CurrentThemeBlock.php in Lingotek Translation 3.6.x
Same filename and directory in other branches
- 8.2 tests/modules/lingotek_test/src/Plugin/Block/CurrentThemeBlock.php
- 4.0.x tests/modules/lingotek_test/src/Plugin/Block/CurrentThemeBlock.php
- 3.0.x tests/modules/lingotek_test/src/Plugin/Block/CurrentThemeBlock.php
- 3.1.x tests/modules/lingotek_test/src/Plugin/Block/CurrentThemeBlock.php
- 3.2.x tests/modules/lingotek_test/src/Plugin/Block/CurrentThemeBlock.php
- 3.3.x tests/modules/lingotek_test/src/Plugin/Block/CurrentThemeBlock.php
- 3.4.x tests/modules/lingotek_test/src/Plugin/Block/CurrentThemeBlock.php
- 3.5.x tests/modules/lingotek_test/src/Plugin/Block/CurrentThemeBlock.php
- 3.7.x tests/modules/lingotek_test/src/Plugin/Block/CurrentThemeBlock.php
- 3.8.x tests/modules/lingotek_test/src/Plugin/Block/CurrentThemeBlock.php
Namespace
Drupal\lingotek_test\Plugin\BlockFile
tests/modules/lingotek_test/src/Plugin/Block/CurrentThemeBlock.phpView source
<?php
namespace Drupal\lingotek_test\Plugin\Block;
use Drupal\Core\Block\BlockBase;
/**
* Block that shows the current theme.
*
* @Block(
* id = "current_theme_block",
* admin_label = "Current theme block",
* )
*/
class CurrentThemeBlock extends BlockBase {
/**
* {@inheritdoc}
*/
public function build() {
$theme = \Drupal::theme()
->getActiveTheme()
->getName();
return [
'#markup' => $this
->t('Current theme: @theme', [
'@theme' => $theme,
]),
];
}
}
Classes
Name | Description |
---|---|
CurrentThemeBlock | Block that shows the current theme. |