CHAPTER 10

image

Adding PHP-Generated Output to Your Drupal Module

Now you can plug your knowledge of PHP into your basic Drupal module. The hello_world.module file itself in your module, of course, uses PHP as the essential piece of the module, the Controller, the class, and more. But also in this chapter you’ll see how to use PHP to help construct the output on the screen for the user. Knowing PHP well will allow you to add dynamic content to your module, which would require variables, if statements, and other complex logic. PHP is used as the nuts and bolts of Drupal itself and all its modules, and it will be a staple for all of your custom module ...

Get Drupal 8 for Absolute Beginners now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.