How can I alter the body_classes_array through hook_menu?

588 Views Asked by At

I'd like to add a css class to the body_classes_array as if I were using template_preprocess_page to alter &$vars, but I'd like to do it through hook_menu() page callback.

Is it even possible to do?

1

There are 1 best solutions below

2
On

No it's impossible to use hook_menu for that. All you can use it for is to create menu items.

The hook system that drupal uses is designed to let you do very specific things with each hook.