needlogin=true; $me = new User(); $me->loadMe(); $this->me = $me; $this->layout()->set("me",$me); if(!$me->is(["Admin", "netowner", "netoperator", "lineworker"])) { $this->redirect("Dashboard"); } } protected function indexAction() { $this->layout()->setTemplate("Patching/Index"); $terminations = PatchingModel::searchByTermination(); $terms = []; foreach($terminations as $term) { $term->order = OrderModel::getFirst(["termination_id" => $term->id]); $terms[] = $term; //var_dump($term); } //exit; $this->layout()->set("terminations", $terms); } }