本文整理汇总了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');
}