Silverstripe Coding Conventions

To manage well defined code which can easily be passed between developers.

Classes - camelCase


Static methods should be in lowercase_with_underscores() format:

public static function my_static_method() {}



Page Controller - Displaying current page controls. Methods available on the template

Page - Methods available to the object, e.g. what is allowed in the cms.  

However, once you enter a <% control %> ... <% end_control %> structure, you deal with DataObjects. That goes as well for pages that are returned by Children(), Menu() or DataObject::get() methods: they are Page objects - NOT Page_Controllers, so you can only access their Page methods.


The Controller class handles the responsibility of delivering the correct outgoing SS_HTTPResponse for a given incoming SS_HTTPRequest.


Controllers are the main handlers for functionality like interactive forms, rendering the correct templates and performing and navigating around the permission checks on the users actions