Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » Arguments in Page_Controller

Our old forums are still available as a read-only archive.

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

Page: 1
Go to End
Author Topic: 1330 Views
  • dio5
    Avatar
    Community Member
    501 Posts

    Arguments in Page_Controller Link to this post

    So I have this function Gravatar() in my pagecontroller. How would I access it in my template? I always seem to get parse errors when using arguments?

    function Gravatar($email= "")
       {
          $size = 40;
          $grav_url = "http://www.gravatar.com/avatar.php?gravatar_id=".md5($email)."&size=".$size;
          $img = "<img src='$grav_url' alt='A member picture' />";
          return $img;
       }

    I'm probably doing it the wrong way...?

  • dio5
    Avatar
    Community Member
    501 Posts

    Re: Arguments in Page_Controller Link to this post

    Fixed. Placed it in the DataObjectDecorator of Member...

    But still want to hear how I would do it the old way...?

    1330 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.