Inicio › API reference ›
hook_init
hooks/core.php, line 873
- Versions
- hooks
hook_init()
Perform setup tasks. See also, hook_boot.
This hook is run at the beginning of the page request. It is typically used to set up global parameters which are needed later in the request. when this hook is called, all modules are already loaded in memory.
For example, this hook is a typical place for modules to add CSS or JS that should be present on every page. This hook is not run on cached pages - though CSS or JS added this way will be present on a cached page.
Valor de retorno
None.
Código
<?php
function hook_init() {
drupal_add_css(drupal_get_path('module', 'book') .'/book.css');
}
?> 
Comentarios recientes
hace 17 horas 50 mins
hace 1 día 10 horas
hace 1 semana 21 horas
hace 14 semanas 4 días
hace 19 semanas 19 horas
hace 20 semanas 2 días
hace 20 semanas 5 días
hace 20 semanas 5 días
hace 21 semanas 2 días
hace 22 semanas 1 día