This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
public function onBeforeWrite(){ | |
parent::onBeforeWrite(); | |
$this->FullName = $this->FirstName . " " . $this->LastName; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
Name: myConfig | |
After: | |
- 'framework/*' | |
- 'cms/*' | |
--- | |
# YAML configuration for SilverStripe | |
# See http://doc.silverstripe.org/framework/en/topics/configuration | |
# Caution: Indentation through two spaces, not tabs | |
SSViewer: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$relations = $this->stat('has_many'); | |
$dropdowns = []; | |
foreach($relations as $name => $obj){ | |
$field = Dropdown::create($name) | |
->setTitle(Config::inst()->get($obj, 'singular_name')) | |
->setEmptyString('Select one') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
LeftAndMain: | |
extra_requirements_css: [my-module-name/css/leftandmainextracss.css] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
public function getCMSFields() { | |
$fields = Parent::getCMSFields(); | |
$fields->addFieldToTab('Root.Compare Vehicles', new TextField('Title')); | |
$fields->addFieldToTab('Root.Compare Vehicles', LabelField::create('Model 1')); | |
//ArrayList::create(Car::get()->toArray())->RemoveDuplicates('MakesName'); | |
$map = Car::get()->map('ID', 'MakesNiceName')->toArray(); | |
$makes = new DropdownField('MakesName', 'MakesName', $map); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Class ListHelper | |
*/ | |
class ListHelper | |
{ | |
/** | |
* This method converts a {@link DataList} to an {@link ArrayList} with an option to add |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
#parse("PHP File Header.php") | |
class ${NAME} extends DataObject { | |
private static \$db = array(); | |
private static \$has_one = array(); | |
private static \$has_many = array(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* [list_searcheable_acf list all the custom fields we want to include in our search query] | |
* @return [array] [list of custom fields] | |
*/ | |
function list_searcheable_acf(){ | |
$list_searcheable_acf = array("title", "sub_title", "excerpt_short", "excerpt_long", "xyz", "myACF"); | |
return $list_searcheable_acf; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<% if $EducationalPost %> | |
<% loop $EducationPost %> | |
<div class="description-block"> | |
<h3>$Title</h3> | |
<img src="$MainImage.Filename"> | |
<p>$Teaser</p> | |
<span class="clearfix"></span> | |
</div> | |
<% end_loop %> | |
<% else %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$results = episode::getEpsThreeDays(date("Y-m-d 00:00:00", $startDate->format('U'))); | |
$list = ArrayList::create(); | |
foreach($results as $result){ | |
$arrayListItem = ArrayData::create($result); | |
$list->push($arrayListItem); | |
} |