本文整理汇总了PHP中request::input方法的典型用法代码示例。如果您正苦于以下问题:PHP request::input方法的具体用法?PHP request::input怎么用?PHP request::input使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类request
的用法示例。
在下文中一共展示了request::input方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: updatePoint
public function updatePoint($id, request $request)
{
$hairstyles = hairstyles::find($id);
$hairstyles->Xpoint = $request->input('Xpoint');
$hairstyles->Ypoint = $request->input('Ypoint');
$hairstyles->save();
return redirect()->intended('hairstyles/edit/' . $id);
}
示例2: update
public function update($id, request $request)
{
$categories = Categories::find($id);
$categories->name = $request->input('name');
$categories->description = $request->input('description');
$categories->save();
return redirect()->intended('categories');
}
示例3: index
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index(request $request)
{
DB::enableQueryLog();
$imei = $request->input('imei');
$api = $request->input('api');
$client = ApiKeys::where('api', $api)->where('imei', $imei)->count();
if ($client > 0) {
$jsonArray = ["api" => true, "message" => ""];
} else {
$jsonArray = ["api" => false, "message" => "Client not registered."];
}
return response()->json($jsonArray);
}
示例4: store
/**
* Store Emails for updates in the future
*
* @return Response
*/
public function store(request $request)
{
$email = new Email();
$email->email = $request->input('email');
$email->save();
return redirect()->back();
}
示例5: action_index
public function action_index()
{
$input = request::input();
// create object and load data
$object = new numbers_backend_system_menu_model_datasource_menu();
$data = $object->get(['where' => ['type' => [1, 2], 'group1_code' => $input['group1_code'] ?? null, 'group2_code' => $input['group2_code'] ?? null, 'group3_code' => $input['group3_code'] ?? null]]);
// assemble data
$name = '';
$icon = '';
if (!empty($input['group1_code'])) {
$name = $data[$input['group1_code']]['name'];
$icon = $data[$input['group1_code']]['icon'];
$data = $data[$input['group1_code']]['options'];
// if we have options
if (!empty($input['group2_code'])) {
$name = $data[$input['group2_code']]['name'];
$icon = $data[$input['group2_code']]['icon'];
$data = $data[$input['group2_code']]['options'];
// if we have options
if (!empty($input['group3_code'])) {
$name = $data[$input['group3_code']]['name'];
$icon = $data[$input['group3_code']]['icon'];
$data = $data[$input['group3_code']]['options'];
}
}
}
echo html::segment(['type' => 'primary', 'value' => $this->render_options($data, $name, $icon)]);
}
示例6: update
public function update($id, request $request)
{
$apikeys = ApiKeys::find($id);
$apikeys->imei = $request->input('imei');
$apikeys->save();
return redirect()->intended('clients');
}
示例7: action_index
public function action_index()
{
// clear buffer
helper_ob::clean_all();
// validating
do {
$options = application::get('flag.numbers.backend.cron.base');
// token
if (!empty($options['token']) && request::input('token') != $options['token']) {
break;
}
// ip
if (!empty($options['ip']) && !in_array(request::ip(), $options['ip'])) {
break;
}
// get date parts
$date_parts = format::now('parts');
print_r($date_parts);
echo "GOOD\n";
} while (0);
// we need to validate token
//$token = request::input('token');
echo "OK\n";
// exit
exit;
}
示例8: index
/**
* Show the application welcome screen to the user.
*
* @return Response
*/
public function index(request $request)
{
if ($request->input('st')) {
$site_id = $request->input('st');
$state_id = DB::table('site_details')->where('id', '=', $site_id)->pluck('state_id');
if ($state_id) {
$parameters = DB::table('parameters')->join('tests', 'tests.parameter_id', '=', 'parameters.id')->where('tests.state_id', '=', $state_id)->orderBy('parameters.name')->get();
}
} else {
$state_id = "";
$parameters = DB::table('parameters')->orderBy('parameters.name')->get();
}
$users = DB::table('users')->where('role_id', '=', 3)->select('id', 'name', 'email')->get();
$customers = Customer::all();
$orders = Order::where('customer_id', '=', 14)->get();
return view('order/index')->with(compact('parameters', 'users', 'orders', 'customers', 'state_id'));
}
示例9: update
public function update($id, request $request)
{
$frames = Frames::find($id);
$image = $frames->image;
$file = $request->file('image');
if (!empty($file)) {
$destinationPath = 'uploads/frames';
// upload path
$fileName = $request->file('image')->getClientOriginalName();
// renameing image
$request->file('image')->move($destinationPath, $fileName);
// uploading file to given path
} else {
$fileName = $image;
}
$frames->name = $request->input('name');
$frames->description = $request->input('description');
$frames->image = $fileName;
$frames->save();
return redirect()->intended('frames');
}
示例10: action_renew
/**
* Renew session
*/
public function action_renew()
{
$input = request::input(null, true, true);
$result = ['success' => false, 'error' => []];
if (!empty($input['token'])) {
$crypt = new crypt();
$token_data = $crypt->token_validate($input['token'], ['skip_time_validation' => true]);
if (!($token_data === false || $token_data['id'] !== 'general')) {
$result['success'] = true;
}
}
layout::render_as($result, 'application/json');
}
示例11: action_index
/**
* This would process error message sent from frontend
*/
public function action_index()
{
$input = request::input();
if (!empty($input['token'])) {
$crypt = new crypt();
$token_data = $crypt->token_validate($input['token'], ['skip_time_validation' => true]);
if (!($token_data === false || $token_data['id'] !== 'general')) {
$input['data'] = json_decode($input['data'], true);
error_base::error_handler('javascript', $input['data']['message'], $input['data']['file'], $input['data']['line']);
}
}
// rendering
layout::render_as(file_get_contents(__DIR__ . '/error.png'), 'image/png');
}
示例12: render
public function render()
{
$input = request::input();
$settings = array();
$settings['limit'] = @$input['limit'] ? @intval($input['limit']) : 20;
$settings['offset'] = @intval(@$input['offset']);
// show starting from this row
$settings['orderby'] = isset($input['orderby']) ? $input['orderby'] : $this->list_orderby;
// order by column
$settings['orderdesc'] = isset($input['orderdesc']) ? $input['orderdesc'] : $this->list_orderdesc;
// order direction
$settings['took'] = microtime(true);
// building sql for select
$from = ' FROM ' . $this->list_table . @$this->left_join . ' WHERE 1=1';
// full text search
$full_text_search = array();
$gist_columns = array();
if (!empty($input['full_text_search']) && !empty($this->full_text_search_column)) {
$full_text_search = db::tsquery($this->full_text_search_column, $input['full_text_search'], '|', true, array(), $this->link);
$from .= $full_text_search['where'];
}
// other where
if (!empty($this->where)) {
$from .= $this->where;
}
// getting number of records
if (@$this->list_count_rows) {
$sql = 'SELECT COUNT(*) as rows_count ' . $from;
$result = db::query($sql, '', array(), $this->link);
if (@$result['error']) {
layout::add_message($result['error'], 'error');
}
// use this variable to get number of rows, isset for verification
$settings['count_rows'] = @$result['rows'][0]['rows_count'] ? $result['rows'][0]['rows_count'] : 0;
} else {
// EXPERIMENTAL: increase number of rows fetched by 1 to check whether next row exists
$settings['limit']++;
}
// quering
$sql = 'SELECT ' . $this->select . (!empty($full_text_search['rank']) ? ', ' . $full_text_search['rank'] . ' ts_rank2' : '') . $from;
$sql .= ' ORDER BY ' . (@$full_text_search['orderby'] ? @$full_text_search['orderby'] . ", " : "") . $settings['orderby'] . ($settings['orderdesc'] ? ' DESC' : '');
$sql .= $settings['limit'] ? ' LIMIT ' . $settings['limit'] : '';
$sql .= $settings['offset'] ? ' OFFSET ' . $settings['offset'] : '';
$result = db::query($sql, '', array(), $this->link);
$settings['took'] = round(microtime(true) - $settings['took'], 2);
// processing count
if (!@$this->list_count_rows) {
if (isset($result['rows'][$settings['limit'] - 1])) {
$settings['flag_next_row_exists'] = true;
}
unset($result['rows'][$settings['limit'] - 1]);
$settings['limit']--;
}
$settings['num_rows'] = count($result['rows']);
// rendering list
$ms = '';
// Hidden elements
$ms .= h::hidden(array('name' => 'orderby', 'id' => 'orderby', 'value' => $settings['orderby']));
$ms .= h::hidden(array('name' => 'orderdesc', 'id' => 'orderdesc', 'value' => $settings['orderdesc']));
$ms .= h::hidden(array('name' => 'offset', 'id' => 'offset', 'value' => $settings['offset']));
$ms .= h::hidden(array('name' => 'limit', 'id' => 'limit', 'value' => $settings['limit']));
// if we have no rows
if (empty($result['rows'])) {
$ms .= 'No records found!';
} else {
// main container
$header = $this->header($settings);
$ms .= $header;
$ms .= '<br/>';
$ms .= '<table cellpadding="0" cellspacing="0" class="editor table" width="100%">';
// types
$types = model_presets::get('he_post_type');
// rows
$row_counter = 1;
foreach ($result['rows'] as $k => $v) {
$ms .= '<tr>';
$ms .= '<td class="editor cell numeration" valign="top">' . $row_counter . '. </td>';
$ms .= '<td class="editor cell regular" align="left">';
// generating urls
$url_post = call_user_func_array($this->url_posts, array($v['type'], $v['post_id'], $v['uri']));
$url_type = call_user_func_array($this->url_type, array($v['type']));
// title with icon goes first
$value = $v['title'];
if ($v['type'] == 20) {
$v['icon'] = 'help16.png';
} else {
if ($v['type'] == 10) {
$v['icon'] = 'faq16.png';
}
}
if (!empty($v['icon'])) {
$value = icon::render($v['icon']) . ' ' . $value;
}
$ms .= h::a(array('href' => $url_post, 'value' => $value));
if (isset($v['ts_rank2'])) {
$ms .= ' [' . $v['ts_rank2'] . ']';
}
// entry type
$ms .= ' ' . h::a(array('href' => $url_type, 'value' => $types[$v['type']]['name'], 'style' => 'color:black;'));
$ms .= '<br/>';
//.........这里部分代码省略.........
示例13: process_magic_variables
/**
* Process magic variables
*/
public static function process_magic_variables()
{
$variables_object = new object_magic_variables();
$variables = $variables_object->get();
$input = request::input(null, true, true);
foreach ($variables as $k => $v) {
if (!array_key_exists($k, $input)) {
continue;
}
if ($k == '__content_type') {
$object = new object_content_types();
$data = $object->get();
if (isset($data[$input[$k]])) {
self::$settings['flag']['global'][$k] = $input[$k];
}
} else {
self::$settings['flag']['global'][$k] = $input[$k];
}
}
}
示例14: action_edit
public function action_edit()
{
$form = new numbers_backend_documents_basic_model_form_catalogs(['input' => request::input()]);
echo $form->render();
}
示例15: tabs
/**
* @see html::tabs();
*/
public static function tabs($options = [])
{
$header = $options['header'] ?? [];
$values = $options['options'] ?? [];
$id = $options['id'] ?? 'tabs_default';
// determine active tab
$active_id = $id . '_active_hidden';
$active_tab = $options['active_tab'] ?? request::input($active_id);
if (empty($active_tab)) {
$active_tab = key($header);
}
$result = '';
$result .= '<div id="' . $id . '" class="' . ($options['class'] ?? '') . '">';
$result .= html::hidden(['name' => $active_id, 'id' => $active_id, 'value' => $active_tab]);
$tabs = [];
$panels = [];
$class = $li_class = $id . '_tab_li';
foreach ($header as $k => $v) {
$li_id = $id . '_tab_li_' . $k;
$content_id = $id . '_tab_content_' . $k;
$class2 = $class;
if ($k == $active_tab) {
$class2 .= ' active';
}
if (!empty($options['tab_options'][$k]['hidden'])) {
$class2 .= ' hidden';
}
$tabindex = '';
if (!empty($options['tab_options'][$k]['tabindex'])) {
$tabindex = ' tabindex="' . $options['tab_options'][$k]['tabindex'] . '" ';
}
$tabs[$k] = '<li id="' . $li_id . '" class="' . $class2 . '"' . $tabindex . ' role="presentation"><a href="#' . $content_id . '" tab-data-id="' . $k . '" aria-controls="' . $content_id . '" role="tab" data-toggle="tab">' . $v . '</a></li>';
$panels[$k] = '<div role="tabpanel" class="tab-pane ' . ($k == $active_tab ? 'active' : '') . ' ' . $k . '" id="' . $content_id . '">' . $values[$k] . '</div>';
}
$result .= '<ul class="nav nav-tabs" role="tablist" id="' . $id . '_links' . '">';
$result .= implode('', $tabs);
$result .= '</ul>';
$result .= '<div class="tab-content">';
$result .= implode('', $panels);
$result .= '</div>';
$result .= '</div>';
$js = <<<TTT
\t\t\t\$('#{$id}_links a').click(function(e) {
\t\t\t\te.preventDefault();
\t\t\t\t\$(this).tab('show');
\t\t\t\t\$('#{$active_id}').val(\$(this).attr('tab-data-id'));
\t\t\t});
\t\t\t\$('.{$li_class}').mousedown(function(e) {
\t\t\t\tvar that = \$(this);
\t\t\t\tif (!that.is(':focus')) {
\t\t\t\t\tthat.data('mousedown', true);
\t\t\t\t}
\t\t\t});
\t\t\t\$('.{$li_class}').focus(function(e) {
\t\t\t\te.preventDefault();
\t\t\t\tvar mousedown = \$(this).data('mousedown'), tabindex = parseInt(\$(this).attr('tabindex'));
\t\t\t\t\$(this).removeData('mousedown');
\t\t\t\t\$(this).find('a:first').click();
\t\t\t\tif (!mousedown && tabindex > 0) {
\t\t\t\t\t\$("[tabindex='" + (tabindex + 1) + "']").focus();
\t\t\t\t} else if (mousedown) {
\t\t\t\t\t\$(this).blur();
\t\t\t\t}
\t\t\t\te.preventDefault();
\t\t\t});
TTT;
layout::onload($js);
return $result;
}