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.

General Questions

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

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

changing $Content through page.php


Reply

2 Posts   817 Views

Avatar
Phill

6 February 2009 at 4:26am Community Member, 75 Posts

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

6 February 2009 at 9:20pm Community Member, 787 Posts

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

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

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

return $sContent;

}

good luck !