Sunday 18 December 2016

Drupal Create a small Drupal 8.x module



Drupal Create a small Drupal 8.x module



STEP 1:Getting Started - Background & Prerequisites (Drupal 8)


1.Making a directory


First of all, I am going to update my local repository and then create a new directory. Then, I am going to move into the new directory that I have just created using cd command.


CODE:


             sudo apt-get update


             mkdir task6


             ls

             cd task6


NOTE:


I have used ls to show that I have created  a directory name task6.


2.Cloning and preparing a Module skeleton.


CODE:



           git clone --branch 8.x-1.x https://git.drupal.org/sandbox/sidharrell/2466449.git 
           hello_world_for_drupal_8


     cd hello_world_for_drupal_8





Preparing a Module skeleton.


CODE:


            git checkout skeleton

          
          



STEP 2:Naming and placing your Drupal 8 module.


1.Check for errors behind the scenes


CODE:


            tail -f /var/log/apache2/error.log







2.Change settings in your dev site


  • I am going to add the following code below in my terminal.

         CODE:


                     error_reporting(E_ALL);


                     ini_set('display_errors', TRUE);



                     ini_set('display_startup_errors', TRUE);





Then, I am going to 127.0.0.1 and navigate to Administration→ Configuration→ Development → logging and errors. I need to select  "All messages". (This sets $conf['error_level'] = 2; .)







Then click save configuration

No comments:

Post a Comment