Flag of Ukraine
SymfonyCasts stands united with the people of Ukraine

Drupal 8: Under the Hood

1:11:03

What you'll be learning

This tutorial is built using Drupal 8.0. The fundamental concepts of Drupal 8 - like services & routing - are still valid, but newer versions of Drupal *do* have major differences.
// composer.json
{
    "require": {
        "composer/installers": "^1.0.21", // v1.0.21
        "wikimedia/composer-merge-plugin": "^1.3.0" // dev-master
    }
}

Drupal 8 comes with a shiny new objecy-oriented base, and a lot of hype surrounding it. But personally, I love it. So in this screencast, I'll take you - Drupal 7 dev - through all of the new concepts, paradigms, terms and patterns in Drupal 8.

We'll go beyond how to do something and explore how things actually work in D8. What are routes? How can I use events to tap into core parts of the system? What's all this dependency injection and service stuff? What's this Drupal Console thing I keep hearing about?

If you're serious about mastering D8, then let's go!


Your Guides

Ryan Weaver Leanna Pelham

Buy Access

Join the Conversation?

30
Login or Register to join the conversation
Default user avatar
Default user avatar Ivo Lukač | posted 4 years ago

Really nice one! Hope to create something similar for eZ ;)

3 Reply

With your help, we *should* create something!

2 Reply
Default user avatar

Roger that! :)

1 Reply
Default user avatar

guys You will have a tutorial on doc.ez.no .. you could extends it :)

1 Reply

I also vote for Ez platform tuto it's an amazing CMS.

1 Reply
Default user avatar
Default user avatar Jesus Manuel Olivas | posted 4 years ago

Awesome videos as usual from KNP and thank you so much weaverryan for spreading the word about Drupal Console.

3 Reply
Thomas W. Avatar
Thomas W. Avatar Thomas W. | posted 2 years ago

Well done

2 Reply
Default user avatar
Default user avatar Nicholas Babu | posted 4 years ago

can't wait to get to this tutorial, but first got to learn the basics; Knp TM you're the best.

1 Reply

Ha, get to it!!! :D

Reply
Default user avatar
Default user avatar Chris Weber | posted 4 years ago

It would have been really awesome if you had dove into Twig + Drupal at the end. This series seems to focus on Drupal from a backend perspective, but even backenders need to help the frontend development process by mapping backend process to frontend templates.

So if you were to add a video showing how the ROOOOOOAR method's output could be taken over by a twig template that would help a lot of folks understand a very common Drupal development task.

P.S.: I LOVE THIS SERIES! GREAT JOB!

1 Reply
Default user avatar

https://knpuniversity.com/s... is nice but it would be helpful if you could tie the render array creation with sending the data to a twig template.

Reply

Chris and I talked about this on Twitter - it's in the plans now :)

2 Reply
Default user avatar

Does this tutorial assume familiarity with Drupal 7 development? I know how to USE drupal, but have zero knowledge of DEVELOPING for Drupal whatsoever; I haven't got a clue what the hook system in drupal works, how to create a module, etc. So, in light of this, is this tutorial for me? And will I learn how to create something with it: modules, services, plugins?

Thank you very much.

Reply

Hey Jad,

Unfortunately no, this tutorial do not cover Drupal 7 because Drupal has started using Symfony components since version 8.x. Actually, I'm not sure how different Drupal 8.x regarding Drupal 7.x , but we're talking a lot about Drupal 8.x features in this tutorial.

Cheers!

Reply
Default user avatar

Dear Victor,

Thank you for the speedy reply. So, in light of this, will I end up learning how to create components (themes, modules, so forth) for Drupal 8, or is it all just discussing the new features and architecture of Drupal 8 without providing examples and walkthroughs of how to actually extend Drupal programmatically using the new framework?

I am sorry for the many questions;I just want to know whether this is the right tutorial for me at this turn of my Drupal learning curve, since the official Drupal documentation is dreadful!

Reply

Hey Jad,

Yes, we show how to create a module, route, controller, service, event listener, hooks, and even how to use Drupal console, but IIRC we do not consider creating themes in this course. In shorts, how to *programing* a new functionality in Drupal, but not how to create and manage website through Drupal control panel when you just install ready modules and click buttons, checkboxes, fill in HTML fields etc.

Well, I don't see a value of rewriting here all the themes we cover with this course because, actually, we have table of content on this page, and each chapter has script content - it's exactly what we're talking about in the video. And we provide this script content for free, so you can walk through each chapter and see below the video block what exactly expect in the video.

Anyway, I think it will be useful for you as a Drupal 8.x developer who want programming. Feel free to subscribe and if it's totally not something you're looking for - we will refund you, just let us know by email.

Cheers!

1 Reply
Default user avatar

Thanks a lot, Victor. It seems like what I need!

Reply
Jelle S. Avatar
Jelle S. Avatar Jelle S. | posted 4 years ago

Great tutorial for the basics of making a D8 module. This was very helpful for starting out, but do you plan on making videos for using forms, database queries and user management in Drupal 8 module development? In other words, would you make a more "advanced" series?

Reply

Hey Jelle,

Thanks! And good question :) Well, we'd like to make a more advanced series on Drupal8, but we don't have any certain plans right now - there're a lot of good topics to cover, one of them - Symfony 3.4 and Symfony 4 releases! So, more advances series on D8 won't be very soon, but probably next year we'll prepare something interesting for Drupal. Meanwhile, you can spy on our upcoming screencasts here: https://knpuniversity.com/c...

Cheers!

Reply

Hey Felipe!

It'll be 100% free until Dec 25th :). After that, it'll be part of the subscription and we'll add an individual purchase price.

Cheers!

1 Reply
Default user avatar

This was fantastic! Will you be creating more D8 tutorials?

1 Reply

So good! Thanks so much, Ryan! ;)

Reply
Default user avatar
Default user avatar Hans Nieuwenhuis | posted 4 years ago

Very good tutorial !!

I notice a message in the status report after setting the settings.local.php:

The rebuild_access setting is enabled in settings.php. It is recommended to have this setting disabled unless you are performing a rebuild.

Is this expected ??

Reply

Hi Hans!

Thanks for the nice words! So here's the deal: rebuild_access setting is *off* by default. BUT, as soon as we created the settings.local.php file, *it* has line (the last line) that sets this to true. As long as you don't have this file on production with this setting on, I believe you're just fine.

Cheers!

Reply
Default user avatar
Default user avatar Hans Nieuwenhuis | posted 4 years ago

Error after upgrading to Drupal Console version 0.9.8 ( from 0.9.6 )

When updating drupal console to new version I get errors when using drupal console (

drupal --version

PHP Fatal error: Class 'Drupal\Component\Assertion\Handle' not found in /var/www/html/jhmtest/web/sites/default/settings.local.php on line 31
PHP Stack trace:
PHP 1. {main}() /usr/local/bin/drupal:0
PHP 2. require() /usr/local/bin/drupal:10
PHP 3. require() phar:///usr/local/bin/drupal/bin/console:3
PHP 4. Symfony\Component\Console\Application->run() phar:///usr/local/bin/drupal/bin/console.php:87
PHP 5. Drupal\Console\Application->doRun() phar:///usr/local/bin/drupal/vendor/symfony/console/Application.php:126
PHP 6. Drupal\Console\Helper\DrupalHelper->isValidRoot() phar:///usr/local/bin/drupal/src/Application.php:197
PHP 7. Drupal\Console\Helper\DrupalHelper->isSettingsFile() phar:///usr/local/bin/drupal/src/Helper/DrupalHelper.php:71
PHP 8. include_once() phar:///usr/local/bin/drupal/src/Helper/DrupalHelper.php:94
PHP 9. include() /var/www/html/jhmtest/web/sites/default/settings.php:720

Reply
Default user avatar
Default user avatar Jesus Manuel Olivas | Hans Nieuwenhuis | posted 4 years ago

Hans Nieuwenhuis: in order for us to track and fix this, do you mind to:
* Open an issue at the project page https://github.com/hechoend...
* Join our support channel https://gitter.im/hechoendr...

Reply
Default user avatar
Default user avatar Hans Nieuwenhuis | posted 4 years ago

First of all, I cannot give You enough compliments on these excellent tutorials !!

I have a problem in chapter "Event Subscribers and Dependency Injection Tags"

when I use

class DinoListener implements EventSubscriberInterface{
public function onKernelRequest(GetResponseEvent $event){
var_dump($event);die;

}

The page is empty and the browser says " no response from server.

But when I use:

class DinoListener implements EventSubscriberInterface{
public function onKernelRequest(GetResponseEvent $event){
var_dump($event->getRequest());die;

}

I get output in the browser.

So it seems that var_dumping $event does not generate output, but var_dumping $event->getRequest() does !

I am using Drupal 8.0.1

Regards,

Hans

Reply

Hey Hans!

Ah, thank you so much for the nice words!! I think I know the issue. Sometimes, when you dump a large variable - a variable that a lot of references to other objects - PHP has problems dumping it. This might be the case with the GetResponseEvent inside of Drupal. If you have XDebug installed, then it does some work to make sure this big dump doesn't fail. If you don't have this installed, then sometimes dumping large things will just print forever and ever. But sometimes it will just cause the page to be white. I think that's what's happening for you. The $event->getRequest() probably doesn't have the same recursive object references (i.e. it's smaller), so it doesn't die. Try installing XDebug, or you ever simply wanted to know the class of an event, you could var_dump(get_class($event));

Cheers!

Reply

Cheers! Thanks for the helpful comments / questions along the way!

Reply
Cat in space

"Houston: no signs of life"
Start the conversation!