Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function custom_blocks_theme($existing, $type, $theme, $path) {
- return [
- 'custom_blocks__front_apps' => [
- 'variables' => [
- 'app' => NULL
- ],
- ],
- ];
- }
- /**
- * {@inheritdoc}
- */
- public function build() {
- return [
- '#theme' => 'custom_blocks__front_apps',
- '#app' => 'test value',
- ];
- }
- <p>Hello: {{ app }}</p>
- /**
- * Implements hook_theme() to add the template definition.
- **/
- function lotus_theme($existing, $type, $theme, $path) {
- return [
- 'lotus_template' => [
- 'variables' => ['test_var' => NULL],
- ],
- ];
- }
- public function build() {
- return array[
- '#theme' => 'lotus_template',
- '#test_var' => $this->t('Test Value'),
- ];
- }
- <p> This is the lotus template with a value of {{ test_var }} </p>
Add Comment
Please, Sign In to add comment