impresspages / ImpressPages

ImpressPages is php framework with admin panel. Build functional website in one hour.
http://www.impresspages.org
Other
501 stars 178 forks source link

How to set or change page content from Filter or Event. #870

Open Twiggled opened 6 years ago

Twiggled commented 6 years ago

I want to change some content of my pages before it is displayed but i have tried the codes below but no changes seem to happen either using Filter or Event. Below are what i have tried separately but none of them seem to work.

class Filter { public static function ipSendResponse($response) { if (is_object($response) && $response instanceof \Ip\Response\Layout) { $response->setContent('DUMMY CONTENT'); }

    return $response;
}

}

class Event { public static function ipBeforeResponseSent($response) { $response->setContent('DUMMY CONTENT'); } }

what am i doing wrong and what is the best way to change the entire content on a page? Also this is a Multisite Site. If that makes a difference.