Quote from: blankcheck at Jul 03, 2012, 02:06 AM
Bob, this should also return current context's key...
Yes, it does, but it's a MODX convention to get the value of class variables with the class get() method (with a few exceptions like $modx->resource, $modx->user, and $modx->context).. The get() method is guaranteed to work in the future. In a future version, it's possible that $key could be made private to the class and then your method would break.
BTW, out of curiosity, I checked the MODX core code for examples and found this:
$modx->context->get('key') -- (45 matches)
$modx->context->key -- (0 matches)
------------------------------------------------------------------------------------------
PLEASE, PLEASE specify the version of MODX you are using.
MODX info for everyone:
http://bobsguides.com/modx.html