user; $luser = $this->luser; $this->template->user = $user; # sort addresslists by name $idmap = []; foreach($luser->addresslists as $list) { $idmap[$list->primary] = $list->name; } natcasesort($idmap); $addresslists=[]; foreach($idmap as $key => $value) { $addresslists[] = $luser->addresslists[$key]; } $this->template->addresslists = $addresslists; $this->template->target = $this->selectTarget; } public function actionSelect($id, $addresslist) { $luser = $this->luser; $mailing = $luser->get_mailing($id); $addresslist = $luser->get_addresslist($addresslist); $mailing->addresslist = $addresslist; $this->redirect("Mailing:default", ['id' => $id]); } }