本文整理汇总了PHP中UserController::save方法的典型用法代码示例。如果您正苦于以下问题:PHP UserController::save方法的具体用法?PHP UserController::save怎么用?PHP UserController::save使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UserController
的用法示例。
在下文中一共展示了UserController::save方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: function
UserController::handle_logout();
});
$routes->get('/user/:id', function ($id) {
UserController::show($id);
});
$routes->post('/user/:id', function ($id) {
UserController::update($id);
});
$routes->post('/user/:id/destroy', function ($id) {
UserController::destroy($id);
});
$routes->get('/signup', function () {
UserController::new_user();
});
$routes->post('/signup', function () {
UserController::save();
});
$routes->get('/user', function () {
UserController::all();
});
$routes->get('/user/:id/edit', function ($id) {
UserController::edit($id);
});
$routes->post('/user/:id/edit', function ($id) {
UserController::updateUsername($id);
});
$routes->get('/user/:id/password', function ($id) {
UserController::editPassword($id);
});
$routes->post('/user/:id/password', function ($id) {
UserController::updatePassword($id);
示例2: __construct
include_once '../models/UserModel.php';
class UserController extends ParentController
{
public function __construct()
{
$this->model = new UserModel();
}
}
$controller = new UserController();
if (isset($_GET["get"]) && isset($HTTP_RAW_POST_DATA)) {
$json = json_decode($controller->getWhere(null, json_decode($HTTP_RAW_POST_DATA)->data));
if ($json->affected_rows === 1) {
session_start();
$_SESSION["id_usuario"] = $json->objects[0]->id_usuario;
$_SESSION["rol"] = $json->objects[0]->usu_rol;
$_SESSION["nombres"] = $json->objects[0]->usu_nombres;
$_SESSION['apellidos'] = $json->objects[0]->usu_apellidos;
$_SESSION['usuario'] = $json->objects[0]->usu_usuario;
}
print json_encode(array("success" => $json->affected_rows === 1, "user" => $json->objects[0]));
if (isset($_GET["login"])) {
}
} else {
if (isset($_GET["save"]) && isset($HTTP_RAW_POST_DATA)) {
print $controller->save($_GET["save"], json_decode($HTTP_RAW_POST_DATA)->data);
} else {
if (isset($_GET["delete"])) {
print $controller->delete($_GET["delete"]);
}
}
}
示例3:
break;
case "edit":
$user->edit($id);
break;
case "save":
$vars['edittype'] = $_POST['edittype'];
$vars['password'] = $_POST['password'];
$vars['password2'] = $_POST['password2'];
$vars['id'] = $_POST['id'];
$vars['user_id'] = $_POST['user_id'];
$vars['user_name'] = $_POST['user_name'];
$vars['title'] = $_POST['title'];
$vars['level'] = $_POST['level'];
$vars['email'] = $_POST['email'];
$vars['active'] = $_POST['active'];
$user->save($p, $vars);
break;
case "delete":
$user->delete($id);
break;
case "batchDelete":
$ids = $_POST['del'];
$user->batchDelete($p, $ids);
break;
case "chgpasswd":
$user->chgpasswd($id);
break;
case "chgpasswdsave":
$vars = $_POST;
$user->chgpasswdsave($vars);
break;