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.

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


1132 Views

Avatar
MarcusDalgren

Community Member, 288 Posts

20 July 2009 at 3:08pm

Hello.

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.