Main navigation

Breadcrumb

Create a simple module to use Drupal 8 Hook System

Submitted by editor
on Fri, 07/08/2016 - 10:58

Question

What are the drupal hooks and how to use drupal hooks ?

Drupal 8 Hook System

Hooks allow modules to alter the drupal core behavior or another module. Hooks are discovered and called at specific times to alter or add to the base behavior or data (invoking the hook). Each hook has a name start with hook_ (Ex; hook_menu()). Your modules can also define their own hooks, in order to let other modules interact with them.

My question is... Where does the hook module go? Does it need to be installed with Composer (I just copied it in where paragraphs.module is) Are there any other overhead steps that needs to be done? (editing other files?)

I tried several locations and cleared all caches each time. Thanks for any help or ideas!