Skip to content

Instantly share code, notes, and snippets.

@wernerkrauss
Last active May 25, 2016 06:34
Show Gist options
  • Save wernerkrauss/761b77d3d454961700aa0b998b9e7c6a to your computer and use it in GitHub Desktop.
Save wernerkrauss/761b77d3d454961700aa0b998b9e7c6a to your computer and use it in GitHub Desktop.
Some PHPStorm / Intellij IDEA file templates for SilverStripe development
<?php
#parse("PHP File Header.php")
class ${NAME} extends DataObject {
private static \$db = array();
private static \$has_one = array();
private static \$has_many = array();
private static \$many_many = array();
private static \$belongs_many_many = array();
private static \$singular_name = '${Name}';
private static \$plural_name = '${Name}s';
private static \$summary_fields = array();
private static \$searchable_fields = array();
public function getCMSFields() {
\$fields = parent::getCMSFields();
return \$fields;
}
}
<?php
#parse("PHP File Header.php")
class ${NAME} extends Page {
private static \$db = array();
private static \$has_one = array();
private static \$has_many = array();
private static \$many_many = array();
private static \$belongs_many_many = array();
private static \$singular_name = '${Name}';
private static \$plural_name = '${Name}s';
private static \$summary_fields = array();
private static \$searchable_fields = array();
public function getCMSFields() {
\$fields = parent::getCMSFields();
return \$fields;
}
}
class ${NAME}_Controller extends Page_Controller {
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment