Here we are going to create a custom module which will print Hello World
in a page under the path: mypage/page
. Follow the basics steps involved in the custom module development in Drupal 8. Before that, we will discuss the Drupal root directory structure.
Look at the preceding screenshot. We will see what each directory contains:
/core
: All the files provided by core that don't have an explicit reason to be in the / directory./modules
: The directory into which all the custom and contrib modules go. Splitting this up into the sub-directories contrib and custom can make it easier to keep track of the modules./profiles
: This folder contains contributed and custom profiles./sites/[domain OR default]/{modules,themes}
: Site specific modules and themes can be moved into these directories to avoid them showing up on every site.sites/[domain OR default]/files
: Site specific files tend to go here...