Drupal 8 module development #3 – adding a settings page

lirantal

Liran is 31 years old and married to his beloved soul-mate Tal. As an avid supporter of the open source community, he plays the role of leading developer for some projects and contributing code to many others. Some of his geek activities include programming, playing his guitar and even running The Hacker’s Choice BBS back in the pre-Internet days of ’95. Liran is passionate about creating software products, combining his technical skills with an exquisite entrepreneurial spirit and business orientation to build successful ventures. Liran currently works at HP Software, leading the development team on a Drupal based collaboration platform in HP's Live Network R&D group. At HPLN, Liran plays a key role in system architecture design, shaping the technology strategy from planning and development to deployment and maintenance in HP's IaaS cloud. Acting as the technological focal point, he loves mentoring team mates, drive for better code methodology and seek out innovative solutions to support business strategies.

You may also like...

7 Responses

  1. Matthew Tift says:

    Thanks for the posts. I just wanted to point out a couple of minor things that I noticed. First, as of last week SystemConfigFormBase is now ConfigFormBase: https://drupal.org/node/2089731. Also, {@inheritdoc} should not be combined with other comments, but there is an issue to change that: https://drupal.org/node/1994890.

  2. Anonymous says:

     

    SystemConfigFormBase is gone, its ConfigFormBase

     

    Instead of $this->configFactory->get() you have $this->config() available

    You can use $this->t() not t()

     

    <code>use Drupal\Core\Config\ConfigFactory;</code> and <code>use Symfony\Component\DependencyInjection\ContainerInterface;</code> are not needed

  3. lirantal says:

    great feedback, thanks guys!

    I’ll be sure to update the module port as well.

  4. Andrew Wasson says:

    At this point if you make the corrections regarding ConfigFormBase and other changes to the API to get this up and running, the fist time you go to the settings page, you’ll get an warning that $settings['deslash'] doesn’t exist, because it doesn’t yet. What do you think is the best way of handling that…

     

    I was thinking around line 34 after you get all the settings you could check to see if it exists and then set it to zero if it doesn’t. What’s your take on that?

     

    if(!isset($settings['deslash'])) {

     $settings['deslash'] = 0;

    }

     

    Cheers,

    Andrew

  5. Jan says:

    I wanted to add your RSS to feedly but your rss.xml link is broken.

  1. May 10, 2014

    […] previous articles we have started with Drupal 8 initial module porting and worked our way about adding a […]

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>