user3429578
user3429578

Reputation: 1163

How to debug and find variables in twig themes

I'm trying to create a theme for a drupal web site, but I find it difficult to get variables. Here is an example: to get an image form a view I wrote this line

row.content['#row']._entity.field_image.entity.uri.value

How can we define this path ? even with vardumper and dump it's not possible to get this information!! Is there any effective way to determine how variables are structred ?

Upvotes: 0

Views: 106

Answers (1)

valerogarte
valerogarte

Reputation: 156

I would like to suggest you to use Kint. You have to add the following code to dump {{ kint(your_variable) }}

Remember that you have to turn on Twig debugging. You can find more information in: https://www.drupal.org/node/1906392

Upvotes: 1

Related Questions