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.

Archive /

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

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

Arguments in Page_Controller


Go to End


2 Posts   1623 Views

Avatar
dio5

Community Member, 501 Posts

30 September 2007 at 9:52pm

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

Avatar
dio5

Community Member, 501 Posts

30 September 2007 at 10:22pm

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

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