Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Twiggled opened this issue Dec 19, 2017 · 0 comments
Open

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

Twiggled opened this issue Dec 19, 2017 · 0 comments

Comments

@Twiggled
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant