I need to show the list of members in a group to approve based on a field in members
So, I created a MembersToApprovePage.php and extended Page with also a page controller.
- MembersToApprovePage.php
<?php
/**
* Defines the MembersToApprovePage page type
*/
class MembersToApprovePage extends Page {
static $db = array (
);
static $has_one = array (
);
static $allowed_children = array('MembersToApprovePage');
}
class MembersToApprovePage_Controller extends Page_Controller {
function MembersNeedingApproval($num=10) {
$membersta = DataObject::get_one("MembersToApprovePage");
return ($membersta) ? DataObject::get("MembersToApprovePage", "ParentID = $membersta->ID", "DESC", "", $num) : false;
}
}
?>
The Page shows up in the CMS fine when I create a page and select a page type, but it doesn't render and I get an error.
Does anyone know of a good tutorial that explains querying a table and showing the list on a page? I tried to emulate Tutorial-2 extending a basic site, but apparently not well enough.
Terry