Skip to content

Instantly share code, notes, and snippets.

@7rin0
Last active April 18, 2019 11:57
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 7rin0/af9c7aa9b6b03b04754d450c2b123db3 to your computer and use it in GitHub Desktop.
Save 7rin0/af9c7aa9b6b03b04754d450c2b123db3 to your computer and use it in GitHub Desktop.
Debug Drupal 8 with VarDumper

Add Drupal 8 repository

  • composer require --dev symfony/var-dumper

composer require --dev drupal/devel:1.0.0-rc1

  • drush en devel -y; drush cr;

Your Project Drupal 8

  • http://{PROJECT_D8_SERVERNAME}/fr/admin/config/development/devel

Check and Save

  • Check "Symfony var-dumper" option and save

Application

  • kpr($form_state->getValues());

  • dump(entity->toArray());

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment