本文整理匯總了PHP中UserController::create方法的典型用法代碼示例。如果您正苦於以下問題:PHP UserController::create方法的具體用法?PHP UserController::create怎麽用?PHP UserController::create使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類UserController
的用法示例。
在下文中一共展示了UserController::create方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: function
TaskController::markasdone($id);
});
$routes->get('/task/:id/markasundone', function ($id) {
TaskController::markasundone($id);
});
$routes->post('/login', function () {
SessionController::store();
});
$routes->get('/login', function () {
SessionController::create();
});
$routes->get('/logout', function () {
SessionController::destroy();
});
$routes->get('/signup', function () {
UserController::create();
});
$routes->post('/signup', function () {
UserController::store();
});
$routes->get('/user', function () {
UserController::index();
});
$routes->get('/user/:id', function ($id) {
UserController::show($id);
});
$routes->post('/user/:id', function ($id) {
UserController::update($id);
});
$routes->get('/user/:id/edit', function ($id) {
UserController::edit($id);
示例2: header
switch ($op) {
case 'login':
$username = $_POST['user'];
$password = $_POST['pass'];
if ($user_controller->login($username, $password) == 'true') {
header("Location:dashboard1.php");
} else {
header("Location:login.php?err=1");
}
break;
case 'register':
$usertype = $_POST['inputUsertype'];
$name = $_POST['inputText'];
$password = $_POST['inputPassword'];
$email = $_POST['inputEmail'];
if ($user_controller->create($usertype, $name, $password, $email) == false) {
header("Location:register.php?err=1");
} else {
header("Location:dashboard.php");
}
break;
case 'creategroup':
$name = $_POST['inputgroup'];
// $group_member=$_POST['member1'];
// $email=$_POST['email1'];
$createdby = $_POST['createdby'];
$email_id = $_POST['email_id'];
if ($user_controller->create_group($name, $createdby, $email_id) == false) {
header("Location:create_events.php?err=2");
} else {
header("Location:create_group.php?group={$name}&success=yes");