Answer the question
In order to leave comments, you need to log in
How to pass an array from a snippet to a chunk in MODx?
For example, there is a snippet that should return an array, let's say this:
array(
'value' => 'some_value',
'class => 'some_class'
)
<span class="some_class">some_value</span>
Answer the question
In order to leave comments, you need to log in
In the chunk (let it be called, say, `yourChunk`) specify:
<span class=""></span>
In the snippet, make the following call:
$output = $modx->getChunk('yourChunk',array(
'class' => 'some_class',
'value' => 'some_value'
));
return $output;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question