Alternate ways to render a controller action output
We may need to do something more complex than opening a popup with some static text. Maybe we can show more data about a specific weather forecast, such as pressure, humidity, and wind speed.
We need to define a new controller action to render the details of a forecast for a specific city at a specific date and time. The controller action will use a new theme hook to render a set of detailed information:
function alps_weather_theme(): array { return [ [...] 'alps_weather_details' => [ 'variables' => [ 'forecast' => [], 'units' => 'metric', ], ], ]; }
The alps_weather_details
theme hook takes the same variables...