What are hooks in Drupal ?

devquora
devquora

Posted On: Feb 22, 2018

 

Drupal Hooks allow modules to interact with the Drupal core.

Drupal’s module system is based on the concept of “hooks”. A hook is a PHP function that is named foo_bar(), where “foo” is the name of the module (whose filename is thus foo.module) and “bar” is the name of the hook. Each hook has a defined set of parameters and a specified result type.

To extend Drupal, a module need simply implement a hook. When Drupal wishes to allow intervention from modules, it determines which modules implement a hook and calls that hook in all enabled modules that implement it.

    Related Questions

    Please Login or Register to leave a response.

    Related Questions

    Drupal interview questions

    What Is Drupal?

    Drupal (pronounced Dru-Pull) is an open source content management system offering a toolset that rivals those of most commercial alternatives. With integrated social media and e-commerce functionality..

    Drupal interview questions

    List the features of Drupal ?

    Drupal comes withRock solid & high quality platform Powerful templating system. Any XHTML or CSS template can be e..

    Drupal interview questions

    What is a patch in Drupal ?

    In Drupal a patch is a file that consists of a list of differences between one set of files and another. All code ch..