Y
Y
You can just Eugene2017-09-06 12:06:24
JSON
You can just Eugene, 2017-09-06 12:06:24

Why in twig js 2nd level file doesn't accept data from JSON?

For example: I have a data.json file with navigation data (href, title , icon) and so on.
there is a structure:

views
└─── partials
|   └─── _header.twig
|   └─── components
|       └─── navigation
|           └─── _layout.twig
└─── tmp
|   └─── data.json
└─── index.twig

_header.twig is included in the index.twig itself and navigation layout is included in the header itself .... so when I do {% for item in menu %} in the navigation layout file it returns nothing, even no errors
UPDATE:
it's strange that the same the code that is in the navigation layout if inserted into the header will work fine

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question