$modx->setPlaceholder('userName', NULL);
$modx->setPlaceholder('userNameError', NULL);$userName = NULL; $userNameError = NULL;
Unregistered placeholders are skipped until parsing is done, and any remaining ones are simply removed at the end. Additionally, if you use $modx->getPlaceholder() on an unregistered placeholder (or with an invalid key), it will return null explicitly in Revolution, though Evolution will trigger a PHP_NOTICE as it does not check if the key exists before trying to access the unknown index in the placeholder array (though this is ignored unless you enable $modx->stopOnNotice in Evo or set your PHP error level to include PHP_NOTICE).
I am using placeholders to populate a form with values and error messages when it doesn’t pass validation. My question is do I have to initialise these place holders eg.as I would a php variable eg.$modx->setPlaceholder('userName', NULL); $modx->setPlaceholder('userNameError', NULL);or does modx treat an unregistered placeholder as if it were NULL.$userName = NULL; $userNameError = NULL;