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

Custom Function but parameter is always NULL

Go to End

10 Posts   3888 Views


Administrator, 690 Posts

7 July 2008 at 12:46pm

It's not a bug.

What's happening is that the getPage() method defines an accessor for the $obj->Page property. So, in your PHP code, if you write $obj->Page, then it will get the value of that property by executing $obj->getPage().

Properties can't have arguments, so no arguments are ever passed to getPage() when it's used in this way.

The best solution here is to rename getCopyrightRange() to CopyrightRange().


Forum Moderator, 922 Posts

7 July 2008 at 1:01pm

Makes sense, Sam.

Just a bit of a gotcha when it comes to using variables in templates, I guess. :-)


Go to Top