function adds() { $data = array(); if (Funcs::$uri[2] == 'save') { $model = new Cabinet(); $model->saveAdds(); View::$layout = 'empty'; View::render('site/redirect', array('text' => 'Данные успешно сохранены', 'href' => '/cabinet/delivery/')); } elseif (Funcs::$uri[2] == 'edit') { $data['adds'] = Cabinet::getOneAdds(Funcs::$uri[3]); } elseif (Funcs::$uri[2] == 'del') { $model = new Cabinet(); $model->delAdds(); $this->redirect('/cabinet/delivery/'); } View::render('cabinet/deliveryadd', $data); }