Hello,
i try to pass some Variables from modx to a JS "Chunk".
This Chunk is Part of a Extra Package - so i want to keep this in a static File instead of the Database.
I've a local "getChunk" Method in my base Class where i pass a TPL Type into it - if its set to "File" i load the Chunk like this:
$output .= file_get_contents($chunkKey);
$this->modx->setPlaceholders($properties);
That works normal if i load a Chunk just for output its contents somewhere... if i load a Chunk like this - to register it as Script - for example:
$script = $this->snuffbox->getChunk($this->parseChunkKey('market-group-select-treescr'), $scriptFields, 'file');
$this->modx->regClientStartupScript($script);
The Placeholders does'nt get set... (they does, if i just output the chunk for normal output).
If i do the same with with a database chunk
$script = $this->snuffbox->getChunk('testJS', $scriptFields, 'modChunk');
then it works.
Can anyone explain why ?