Private static $variable List

Hi, i was wondering if there is a list or something with all the private static variables that we can use in our silverstripe project, something similar for what we have our .env file.

This can be very handy for new users (like me) to have a single place with all the information we might need to customize our project.

Some examples of what i mean by private static variables:
-private static $summary_fields

  • private static $singular_name
  • private static $menu_priority
1 Like

There’s not a complete, single list because it changes based on the type of class you’re using.

Data is available for all classes though… for example the page below shows all the properties and methods on DataObject:

This is for SiteTree (the parent to your Page classes):

Hope that helps!


Mate, you don’t know how much i’ve been looking for this.
It might not be complete, but it’s definitely a good start, thanks

An alternative (and admittely hackish) way is to inspect the source code for private static. Here is a oneliner that does the job:

grep -or 'private static $\w*' | awk -F'[.:]' '{ if ($1!=g) { print $1; g=$1 } print "\t" substr($3,17) }'

and here is the corresponding results inside vendor/silverstripe/framework/src.

1 Like