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.

Template Questions

Naming conventions


Reply

3 Posts   1093 Views

Avatar
yurigoul

30 October 2009 at 4:42am Community Member, 202 Posts

My question is: Are there naming conventions I should be aware of?

I ask this because I just ran in some trouble because I - and I tested it - forgot to name one my subtheme files with a capital P (as in HomePage.ph versus Homepage.php). This resulted in the following error - but the error is now resolved:

[Warning] Unknown class passed as parameter
GET /s/dev/build

Line 420 in /Applications/MAMP/htdocs/s/sapphire/core/Object.php

This was not very helpful, but ok. I first thought it had to do with the fact that I used Homepage for my class, or a field named about, antother named info.

Avatar
Hamish

2 November 2009 at 10:21pm Community Member, 712 Posts

It is case sensitive, so if your file name is Homepage, the class it contains must also be Homepage.

Avatar
yurigoul

4 November 2009 at 12:29am Community Member, 202 Posts

There is more to it, look here: http://silverstripe.org/general-questions/show/272491?showPost=272491