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're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

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