0

All I want to do is print a view out so I can check the variables and see the structure of what's being created but it results in an internal server error.

I'm using Acquia Dev Desktop. I've checked the .htaccess file and it has the rewritebase uncommented. I've tried updating max_execution_time, and memory_limit. Nothing helps.

I have Drupal 8 installed fine and haven't had any issues except when trying to inspect variables.

BTW here is my function in theme file:

function theme_preprocess_views_view(&$variables) {
  $view = $variables['view'];
  print_r($view);
}

What am I doing wrong?

1
  • 1
    What error do you get ? How many views do you display on the desired page ?
    – rémy
    Commented Apr 26, 2016 at 22:23

1 Answer 1

1

Hi!! you can use a official symfony dumper, insert this line on the file "composer.json"

"require-dev": {
    "symfony/var-dumper":"3.0.4"
  }

run the follow command:

composer install "symfony/var-dumper"

or

composer update

you can use in your code with these line:

dump($variable_name);

enjoy!!! ;)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.