Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

changing $Content through page.php


Go to End


2 Posts   1554 Views

Avatar
Phill

Community Member, 81 Posts

6 February 2009 at 4:26am

Hey

I think im asking a real simple question here but how do i change the contents of the $Content template variable through the Page.php file.

So i could run some rugular php on it like
$Content = $Content . ' hello';

Link i said i think im getting stuck on something real simple here :-(

Thanks
Phill

Avatar
Fuzz10

Community Member, 791 Posts

6 February 2009 at 9:20pm

Yeah, you can overload the Content() method...

function Content() {
$sContent = $this->Content;

....do Some nast stuff to $sContent.

return $sContent;

}

good luck !