本文整理汇总了PHP中UserService::storeUser方法的典型用法代码示例。如果您正苦于以下问题:PHP UserService::storeUser方法的具体用法?PHP UserService::storeUser怎么用?PHP UserService::storeUser使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UserService
的用法示例。
在下文中一共展示了UserService::storeUser方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: storeUser
$_SESSION["allowedIn"] = array();
}
array_push($_SESSION["allowedIn"], $user);
}
}
$userDAO = new UserDAO();
$userDAO->createUser("sofie", "test");
var_dump($userDAO);
var_dump($_SESSION["allowedIn"]);
class UserService
{
public function storeUser($username, $password)
{
$userDAO = new UserDAO();
$userDAO->createUser($username, $password);
}
}
$userSvc = new UserService();
$userSvc->storeUser("liesenborghs", "testpwd");
var_dump($userSvc);
var_dump($_SESSION["allowedIn"]);
$userSvc2 = new UserService();
$userSvc2->storeUser("rasschaert", "testpwd2");
var_dump($userSvc2);
var_dump($_SESSION["allowedIn"]);
foreach ($_SESSION["allowedIn"] as $user) {
$username = $user->getUsername();
$password = $user->getPassword();
echo $username, "</br>";
echo $password, "</br>";
}
示例2: phpAlert
<?php
require_once 'business/UserService.php';
require_once 'debugger.php';
session_start();
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
if (isset($_GET["action"]) && $_GET["action"] == "new") {
$usernname = $_POST["username"];
phpAlert($usernname);
phpAlert($_POST["password"]);
$userSvc = new UserService();
$userSvc->storeUser($_POST["username"], $_POST["password"]);
header("location:aanmelden.php");
exit(0);
}
include 'presentation/nieuwegebruikerForm.php';