We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 10152
    • 156 Posts
    Hello in an attempt to integrate tidy into a plugin OnWebPagePreRenderer, I can’t find the equivalent for revolution of this syntax :
    $html = $modx->documentOutput; // evolution syntax
    // tidy
    $tidy = tidy_parse_string($html);
    $tidy->cleanRepair();
    return $tidy->errorBuffer;
    

    I have read the doc and searched in existing plugins or in core but cannot find the answer, that’s why I’m asking.
      • 22303 MODX Staff
      • 10,725 Posts
      That should work, though you would want to use a reference, e.g. $html =& $modx->documentOutput, or just operate directly on $modx->documentOutput. If that still doesn’t work, try using $modx->resource->_output in place of $modx->documentOutput, and let me know so I can file a compatibility bug.
        • 10152
        • 156 Posts
        Oops, thank you I copied/pasted an example it was for evo so I even didn’t try to check, sorry I’ll check the next time.

        EDIT : both do work on RC3
            $modx->documentOutput = $modx->documentOutput.'<!-- '.$site_copyright.' '.date("Y").' --> ';
            $modx->resource->_output =  $modx->resource->_output.'<!-- '.$site_copyright.' '.date("Y").' --> ';