/** * @before _secure, _school */ public function index() { $this->setSEO(array("title" => "Admin | School | Dashboard")); $view = $this->getActionView(); $counts = array(); $counts["students"] = Scholar::count(array("organization_id = ?" => $this->organization->id)); $counts["teachers"] = Educator::count(array("organization_id = ?" => $this->organization->id)); $counts["classes"] = Grade::count(array("organization_id = ?" => $this->organization->id)); $counts = ArrayMethods::toObject($counts); $session = Registry::get("session"); $message = $session->get("redirectMessage"); if ($message) { $view->set("message", $message); $session->erase("redirectMessage"); } $view->set("counts", $counts); }