Guest User

Untitled

a guest
Apr 25th, 2018
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. function custom_blocks_theme($existing, $type, $theme, $path) {
  2. return [
  3. 'custom_blocks__front_apps' => [
  4. 'variables' => [
  5. 'app' => NULL
  6. ],
  7. ],
  8. ];
  9. }
  10.  
  11. /**
  12. * {@inheritdoc}
  13. */
  14. public function build() {
  15. return [
  16. '#theme' => 'custom_blocks__front_apps',
  17. '#app' => 'test value',
  18. ];
  19. }
  20.  
  21. <p>Hello: {{ app }}</p>
  22.  
  23. /**
  24. * Implements hook_theme() to add the template definition.
  25. **/
  26. function lotus_theme($existing, $type, $theme, $path) {
  27. return [
  28. 'lotus_template' => [
  29. 'variables' => ['test_var' => NULL],
  30. ],
  31. ];
  32. }
  33.  
  34. public function build() {
  35.  
  36. return array[
  37. '#theme' => 'lotus_template',
  38. '#test_var' => $this->t('Test Value'),
  39. ];
  40.  
  41. }
  42.  
  43. <p> This is the lotus template with a value of {{ test_var }} </p>
Add Comment
Please, Sign In to add comment