Skip to main content

Drupal 8 Custom Templates q&a

Posted by donpwinston on 

In Drupal 7 I have a web site that makes extensive use of hook_theme and hook_menu. Most of the content is in an Informix database. In the page callback of hook_menu I use the theme() function to pass variables containing data from the database to my custom template defined in hook_theme.

How would I do this or where is the documentation on how to do this in Drupal 8?

 
donpwinston commented 

hook_mennu replaced by yaml files. See https://www.drupal.org/node/1800686

hook_theme is still there. The theme() function apparently is no longer available. So how do you pass your own data to a custom twig template?