Answer the question
In order to leave comments, you need to log in
Why use getOption in modx if the variable is already available?
There are articles on the Internet where the code of some snippets is given. And in the code, the snippet parameters are obtained like this:
$word = $modx->getOption('word', $scriptProperties, '');
<?php
echo $word;
$word = $modx->getOption('word', $scriptProperties, '');
Answer the question
In order to leave comments, you need to log in
In most cases, there is no difference.
$word; // Hello
$scriptProperties['word']; // Hello
$modx->getOption('word', $scriptProperties, ''); // Hello
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question