Hi, I have to DataObjects: Continent and Region.
class Continent extends DataObject {
static $db = array(
'Title' => 'Varchar(255)',
);
static $has_many = array(
'Regions' => 'Region'
);
}
and
class Region extends DataObject {
static $db = array(
'Title' => 'Varchar(255)',
);
static $has_one = array(
"Continent" => "Continent"
);
}
I get them from the DB
function Continents() {
return DataObject::get("Continent", "", "Continent.Title ASC");
}
And use them in the template
<% control Continents %>
<h3>$Title</h3>
<% control Regions %>
<p>$Title</p>
<% end_control %>
<% end_control %>
How can I make sure that the Regions are listed in alphabetical order?