Hello everyone, I'm beginning in module development with Drupal 8 and i have a problem.
I try to make a lorem ipsum module but my configuration file doesn't work properly.
Here is my github project : https://github.com/972/lorem_ispum

Here is my configuration file : https://github.com/972/lorem_ispum/blob/master/config/install/lorem_ispu...

Here is my schema file : https://github.com/972/lorem_ispum/blob/master/config/schema/lorem_ispum...

My problem is when i try to pull information from my configuration file in my controller but it returns me NULL.

Here is an example : https://github.com/972/lorem_ispum/blob/master/src/Controller/LoremIspum...

The $title variable is NULL.

Last question : Do you think that make a module like that is good to begin with module development ?

Thanks for your answers.

Comments

972’s picture

The configuration file have to be set before the installation of the module.

joshi.rohit100’s picture

There is one more problem -

Instead of this -

$config = \Drupal::config('lorem_ispum.settings');
    $title  = $config->get('lorem_ispum.page_title');

This is right -

$config = \Drupal::config('lorem_ispum.settings');
    $title  = $config->get('page_title');
972’s picture

Yes thanks you right, i found that one too ...