Hey guys,
Before SS3, I could load in a dataobject and loop through each item adding fields on the fly which could then be used in the template.
I can't seem to get this working in SS3, any ideas why?
public function Shops(){
$Shops = Shop::get();
foreach($Shops as &$Shop) {
$Shop->URL = trim(preg_replace('/[^a-z0-9]+/', '-', strtolower($Shop->Title)), '-');
}
return $Shops;
}