Skip to content

Instantly share code, notes, and snippets.

@trev
Last active December 26, 2015 02:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save trev/7079343 to your computer and use it in GitHub Desktop.
Save trev/7079343 to your computer and use it in GitHub Desktop.
  • Optimizing response time in SilverStripe using APC and Partial Caching

  • Customizing GridField columns. (Two methods)

    • Use $summary_fields and define custom getter:
      $summary_fields = array('FullName' => 'Full Name');
      public function getFullName() { return $this->FirstName . ' ' . $this->LastName; }
    
    • Use GridField setFieldFormatting() to customize:
      $config->getComponentByType('GridFieldDataColumns')->setFieldFormatting(array(
        'Intake' => function($val, $list) {
          return date('M Y', strtotime($val));
        }
      ));
    
  • Importing CSVs and dealing with relationships.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment