Book Image

Mastering Drupal 8

By : Sean Montague, Chaz Chumley, William Hurley
Book Image

Mastering Drupal 8

By: Sean Montague, Chaz Chumley, William Hurley

Overview of this book

Drupal is an open source content management system trusted by governments and organizations around the globe to run their websites. It brings with it extensive content authoring tools, reliable performance, and a proven track record of security. The community of more than 1,000,000 developers, designers, editors, and others have developed and maintained a wealth of modules, themes, and other add-ons to help you build a dynamic web experience. Drupal 8 is the latest release of the Drupal built on the Symfony2 framework. This is the largest change to the Drupal project in its history. The entire API of Drupal has been rebuilt using Symfony and everything from the administrative UI to themes to custom module development has been affected. This book will cover everything you need to plan and build a complete website using Drupal 8. It will provide a clear and concise walkthrough of the more than 200 new features and improvements introduced in Drupal core. In this book, you will learn advanced site building techniques, create and modify themes using Twig, create custom modules using the new Drupal API, explore the new REST and Multilingual functionality, import, and export Configuration, and learn how to migrate from earlier versions of Drupal.
Table of Contents (25 chapters)
Title Page
Credits
About the Author
Acknowledgments
About the Author
About the Reviewer
Customer Feedback
www.PacktPub.com
Preface

Working with Devel and Kint


The Devel module continues to be a primary method of assisting developers to debug their code. One of the things that's new in the version for Drupal 8 is Kint replacing Krumo as the library used to output debugging information. Using Kint offers a number of improvements over Krumo. The most significant is the ability to see private attributes of objects. Kint uses the PHP Reflection API to get all information about an object, where Krumo used get_object_vars().

Installing the Devel module

To install the Devel module on a new site, you can download it directly from drupal.org/project/devel or by running drush dl devel. From there you can run drush pm-enable devel kint to activate the Devel module and the Kint submodule on your site. You will need to grant the Access kint permission to any roles you want to see Kint debugging output.

Printing variables

Debugging with an interactive debugger such as Zend Debugger or Xdebug is an extremely powerful way to dig deep into...