本文整理匯總了PHP中Symfony\Component\HttpFoundation\Request::input方法的典型用法代碼示例。如果您正苦於以下問題:PHP Request::input方法的具體用法?PHP Request::input怎麽用?PHP Request::input使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Symfony\Component\HttpFoundation\Request
的用法示例。
在下文中一共展示了Request::input方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: handleRequest
protected function handleRequest(Request $request)
{
$fid = \Route::input('id');
$this->forum = Forum::with('perms')->findOrFail($fid);
$this->subject = $request->input('req_subject');
$this->message = $request->input('req_message');
}
示例2: getCurrentPage
/**
* Get the number of the current page.
*
* @return int
*/
public function getCurrentPage()
{
$page = (int) $this->currentPage ?: $this->request->input($this->pageName, 1);
if ($page < 1 || filter_var($page, FILTER_VALIDATE_INT) === false) {
return 1;
}
return $page;
}
示例3: getCode
/**
* Get the code from the request.
*
* @return string
*/
protected function getCode()
{
return $this->request->input('code');
}
示例4: handleRequest
protected function handleRequest(Request $request)
{
$this->credentials = array('username' => $request->input('req_username'), 'password' => $request->input('req_password'));
$this->remember = $request->input('remember');
}
示例5: getOAuth2Code
/**
* {@inheritDoc}
*/
public function getOAuth2Code()
{
return $this->request->input('code');
}
示例6: handleRequest
protected function handleRequest(Request $request)
{
$pid = \Route::input('id');
$this->post = Post::with('author', 'topic')->findOrFail($pid);
$this->message = $request->input('req_message');
}
示例7: handleRequest
protected function handleRequest(Request $request)
{
$this->input = $request->input();
$this->request = $request;
}
示例8: postConfigs
public function postConfigs(Request $request)
{
$input = $request->input();
if (!isset($input['configs'])) {
throw new BadRequestHttpException();
}
foreach ($input['configs'] as $config) {
if (!isset($config['name']) || !isset($config['value'])) {
throw new BadRequestHttpException();
}
}
foreach ($input['configs'] as $config) {
if ($config['value'] === "NULL") {
$config['value'] = null;
}
if (isset($this->configs_validate[$config['name']])) {
$validator = Validator::make([$config['name'] => $config['value']], [$config['name'] => $this->configs_validate[$config['name']]]);
if ($validator->fails()) {
return Response::json($validator->errors()->all(), 400);
}
}
$rules = [];
foreach ($this->configs_validate as $k => $v) {
if (substr($k, 0, strlen($config['name'] . '.')) == $config['name'] . '.') {
$rules[$k] = $v;
}
}
if (!empty($rules)) {
$validator = Validator::make([$config['name'] => $config['value']], $rules);
if ($validator->fails()) {
return Response::json($validator->errors()->all(), 400);
}
}
$this->write_config($config['name'], $config['value']);
}
}
示例9: handleRequest
protected function handleRequest(Request $request)
{
$tid = \Route::input('id');
$this->topic = Topic::with('forum.perms')->findOrFail($tid);
$this->message = $request->input('req_message');
}