-
- 674 Posts
in a plugin when use OnParseDocument the outout repeat ten times,
the code i use is this
$e = $modx->Event;
switch ($e->name) {
case "OnParseDocument":
$a =$modx->insideManager();
if ($_SESSION[’mgrInternalKey’]!=999999999999) {
$html="hello";
$content = $modx->documentOutput ;
$modx->documentOutput = $content.$html;
}else{}
break;
default :
return; // stop here - this is very important.
break;
}
-
- 1,732 Posts
Is it that "hello" is repeated ten times?
-
- 239 Posts
This is probably because your plugin is executed 10 times. 10 is also the maximum amount of parser passes. To verify this theory try changing the $modx->maxParserPasses at the bottom of your index.php file and see if the amount changes accordingly.