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:

Customising the CMS /

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

Why does the controller automatically call the function getTemplate() if it exists?

Go to End



Community Member, 288 Posts

20 July 2009 at 3:08pm


Today I wrote a function in one of my controllers so I could do some template related testing. I called my function getTemplate and went about my business. However when I returned to my controllers base action I was very surprised to discover that the method getTemplate() gets run as well.

I tried searching the docs and I searched the forums, no hits. Is this some special reserved method that isn't documented or is this a bug? I searched in the core classes and only Email has a getTemplate method.