Jump to:

23355 Posts in 17691 Topics by 2862 members

General Questions

SilverStripe Forums » General Questions » changing $Content through page.php

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

Page: 1
Go to End
Author Topic: 787 Views
  • Phill
    Avatar
    Community Member
    75 Posts

    changing $Content through page.php Link to this post

    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

  • Fuzz10
    Avatar
    Community Member
    787 Posts

    Re: changing $Content through page.php Link to this post

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

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

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

    return $sContent;

    }

    good luck !

    787 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.