Skip to content

Instantly share code, notes, and snippets.

View stevie-mayhew's full-sized avatar

Stevie Mayhew stevie-mayhew

  • Auckland, New Zealand
View GitHub Profile
<% loop $Subjects %>
<option value="$ID" <% if $ID == $Up.AssessmentSubjectID %> selected<% end_if %>>$Title</option>
<% end_loop %>
<%-- This has been included to change the scope of the elements so that we can access AssessmentSubjectID easily and we are tired. @todo better code --%>
<%-- Main file --%>
<% loop $Students %>
<% loop $Assessements %> <%-- 'Assessment' --%>
<% loop $Up.Up.Subjects %>
<%-- I want to check if ($Assessment.SubjectID == $ID) --%>
<% end_loop %>
<% include AssessmentSubjectCheck AssessmentSubjectID=$SubjectID, $Subjects=$Up.Up.Subjects %> <%-- This is how we've changed scope to do that above need, see below for the include --%>
<% end_loop %>
<% end_loop %>
@stevie-mayhew
stevie-mayhew / CatalogPageAdmin.php
Created July 31, 2015 01:37
SilverStripe Code Competition
<?php
/**
* Class CatalogPageAdmin - Code submitted by stevie-mayhew
*/
class CatalogPageAdmin extends ModelAdmin {
/**
* @config
* @var string
*/
private static $menu_icon = 'silverstripe-catalogmanager/images/catalog.png';