本文整理汇总了PHP中util::request方法的典型用法代码示例。如果您正苦于以下问题:PHP util::request方法的具体用法?PHP util::request怎么用?PHP util::request使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类util
的用法示例。
在下文中一共展示了util::request方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: doSignIn
public function doSignIn()
{
$prompt = null;
$email = null;
$password = null;
if ($_POST) {
$email = util::request("email", "P");
$password = util::request("password", "P");
if (empty($email)) {
$prompt = "邮箱不能为空";
} else {
if (empty($password)) {
$prompt = "密码不能为空";
} else {
$isOk = true;
//$this->load("user")->checkUser();
if ($isOk) {
util::redirect("http://cgi.daotianhudong.com/?c=admin&a=index");
} else {
$prompt = "用户名或密码错误";
}
}
}
}
$template = resource::getView('admin');
$template->assign("prompt", $prompt);
$template->assign("email", $email);
$template->assign("password", $password);
$template->display('signin.tpl');
}
示例2: run
public function run()
{
isset($_SERVER['argv'][1]) && parse_str($_SERVER['argv'][1], $_GET);
$controlName = substr(util::request('c', 'G', 'index'), 0, 24);
$actionName = 'do' . substr(util::request('a', 'G', 'index'), 0, 36);
$controlFile = FILE . 'controller/' . $controlName . '.php';
if (!is_file($controlFile)) {
@header('HTTP/1.0 404 Not Found');
exit("<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\"><html><head><title>404 Not Found</title></head><body><h1>404 Not Found</h1></body></html>");
}
require FILE . 'controller/base.php';
require $controlFile;
$controlName .= 'Controller';
$control = new $controlName();
call_user_func(array($control, $actionName), array());
}
示例3: doRefreshToken
/**
* 刷新Token
* @return [type] [description]
*/
public function doRefreshToken()
{
$request = OAuth2\Request::createFromGlobals();
$client_id = util::request("client_id", "P");
$client_secret = util::request("client_secret", "P");
$request->server['PHP_AUTH_USER'] = $client_id;
$request->server['PHP_AUTH_PW'] = $client_secret;
$request->headers['PHP_AUTH_USER'] = $client_id;
$request->headers['PHP_AUTH_PW'] = $client_secret;
$this->server->handleTokenRequest($request)->send();
}
示例4: __destruct
public final function __destruct()
{
if ($this->printResult && !util::request('noprint')) {
$this->result['status'] = array('code' => self::$code, 'msg' => self::$msg);
echo json_encode($this->result);
}
}