I need to show some data in modx 404 event.
I have some files in a directory. When i got a specific url in 404 event i wanted to show a file from a specific directory which is not a modx resource.
I was not able to show any custom output. how can i do that?
in plugin i have set plugin event to onPageNotFind and i have tried like this:
global $modx;
if ($modx->event->name == 'OnPageNotFound') {
$out = file_get_contents('my_file');
$modx->event->output( $out);
}
i also tried like this:
global $modx;
if ($modx->event->name == 'OnPageNotFound') {
$out = file_get_contents('my_file');
$strContent = &$modx->resource->_output;
$strContent = $out;
}