本文整理汇总了PHP中input::all方法的典型用法代码示例。如果您正苦于以下问题:PHP input::all方法的具体用法?PHP input::all怎么用?PHP input::all使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类input
的用法示例。
在下文中一共展示了input::all方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: bannerDuzenleKaydet
function bannerDuzenleKaydet($duzenle)
{
$form = input::all();
// $kural = array('ad'=>'required','yol'=>'required','genislik'=>'required','yukseklik'=>'required','url'=>'required','durum'=>'required');
// $dogrulama = \Validator::Make($form,$kural);
// if($dogrulama->fails()) {
// // gönderilen verilerde hata var
// return Redirect::to('admin/bannerDuzenle/'. $duzenle)->withErrors($dogrulama)->withInput();
// }else{
$dosya = Input::file('dosya');
$uzanti = $dosya->getClientOriginalExtension();
$dosyaAdi = date('YmdHis') . "_b." . $uzanti;
$path = base_path('bannerResimler/' . $dosyaAdi);
$imagePath = 'bannerResimler/' . $dosyaAdi;
Image::make($dosya->getRealPath())->save($path);
$sorgu = "UPDATE banner SET ad=?,yol=?, genislik=?, yukseklik=?, url=?, durum=? WHERE id=?";
$islem = DB::update($sorgu, array($form["ad"], $dosyaAdi, $form["genislik"], $form["yukseklik"], $form["url"], $form["durum"], $duzenle));
if ($islem) {
$mesaj = "basarili";
return Redirect::to("admin/bannerListele")->with("mesaj", $mesaj);
} else {
$mesaj = "başarısız";
return Redirect::to("admin/bannerListele")->with("mesaj", $mesaj);
}
}
示例2: store
public function store(Request $request)
{
$rules = array('dmm4-7' => 'required', 'dmm8-13' => 'required', 'dfgd8-13' => 'required', 'lmm4-7' => 'required', 'lmm8-10' => 'required', 'lmm11-13' => 'required', 'lfgd8-13' => 'required');
$validator = Validator::make(Input::all(), $rules);
// if the validator fails, redirect back to the form
if ($validator->fails()) {
session()->flash('error_message', " You can't leave this all empty.");
session()->flash('error_message2', " You can use letters, numbers, Periods, and Hyphen.");
return Redirect::back()->withErrors($validator)->withInput();
$input = input::all();
} else {
$id = $request->input('id');
$data = ServSetModel::find($id);
$data->mm_4_17_db_server = $request->input('dmm4-7');
$data->mm_8_13_db_server = $request->input('dmm8-13');
//$data->mm_11_13_db_server = $request->input('dmm11-13');
$data->fgd_8_13_db_server = $request->input('dfgd8-13');
$data->mm_4_7_logs_server = $request->input('lmm4-7');
$data->mm_8_10_logs_server = $request->input('lmm8-10');
$data->mm_11_13_logs_server = $request->input('lmm11-13');
$data->fgd_8_13_logs_server = $request->input('lfgd8-13');
$data->save();
session()->flash('message', ' Update successfuly.');
return redirect('ais/serverSetting');
}
}
示例3: update
/**
* Update the specified resource in storage.
*
* @param int $id
* @return Response
*/
public function update($id)
{
$conceptomiembro = ConceptoMiembro::findOrFail($id);
$validator = ConceptoMiembro::validator(Input::all());
if ($validator->fails()) {
return Redirect::back()->withErrors($validator)->withInput();
}
$datos = input::all();
$datos['monto'] = (double) $datos['monto'];
$conceptomiembro->update($datos);
Session::flash('message', 'Actualizado Correctamente');
Session::flash('class', 'success');
return Redirect::to('/dashboard/conceptosmiembros/' . $conceptomiembro->miembro->id);
}
示例4: detail
function detail()
{
$params = input::all();
if (!$params['id']) {
header("Content-type: text/html; charset=utf-8");
echo '{error:"' . app::get('site')->_('没有指定具体的模板!') . ',redirect:null"}';
exit;
}
$data = app::get('site')->model('themes')->getList('*', array('theme' => $params['id']));
$theme = $data[0]['theme'];
$pagedata['list'] = kernel::single('site_theme_tmpl')->get_edit_list($theme);
$pagedata['types'] = kernel::single('site_theme_tmpl')->get_name($this->platform);
$pagedata['theme'] = $theme;
$pagedata['pagehead_active'] = 'pagem';
//设置可视化编辑页面(默认and非默认)
$defaultIndexFile = kernel::single('site_theme_tmpl')->get_default('index', $theme);
$nodefaultindex = $this->app->model('themes_tmpl')->getList('tmpl_path', array('theme' => $theme, 'tmpl_type' => 'index'));
$pagedata['current']['default_index_file'] = $defaultIndexFile ? $defaultIndexFile : $nodefaultindex[0]['tmpl_path'];
$pagedata['platform'] = $this->platform;
return $this->singlepage('site/admin/theme/tmpl/frame.html', $pagedata);
}
示例5: regpromotion
/**
* @author: Arham
* @param Request $request
* @param: none
* desc: validate the form, store customer details to database and generate a
* unique id and if the registration success then send an e-mail to customer
* created : 24/03/2016
*/
public function regpromotion(Request $request)
{
$nm = null;
$lnm = null;
$ad = null;
$mail = null;
$phone = null;
$rid = 0;
$validate2 = validator::make(input::all(), array('first_name' => 'required|alpha', 'last_name' => 'required|alpha|different:first_name', 'email' => 'required|email|unique:regpromotion', 'contact_number' => 'required|unique:regpromotion|digits:10', 'address' => 'required'));
$rp = 0;
if ($validate2->fails()) {
return view('pages\\Discount\\registerpromotion', ['rp' => $rp, 'nm' => $nm, 'lnm' => $lnm, 'ad' => $ad, 'mail' => $mail, 'phone' => $phone, 'rid' => $rid])->withErrors($validate2);
}
$fname = Input::get('first_name');
$lname = Input::get('last_name');
$email = Input::get('email');
$cno = Input::get('contact_number');
$address = Input::get('address');
$cid1 = Auth::user()->id;
$id = DB::table('regpromotion')->select('cid')->get();
foreach ($id as $id1) {
if ($cid1 == $id1->cid) {
$rid = 1;
return view('pages\\Discount\\registerpromotion', ['rp' => $rp, 'nm' => $nm, 'lnm' => $lnm, 'ad' => $ad, 'mail' => $mail, 'phone' => $phone, 'rid' => $rid])->withErrors($validate2);
}
}
function generateRandomString($length = 10)
{
$characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
$charactersLength = strlen($characters);
$randomString = '';
for ($i = 0; $i < $length; $i++) {
$randomString .= $characters[rand(0, $charactersLength - 1)];
}
return $randomString;
}
$prokey = generateRandomString();
Mail::send('pages/discount/promotionmail', array("prokey" => $prokey, 'fname' => $fname, 'lname' => $lname), function ($message) {
$message->from('paintbuddyProj@gmail.com');
$message->to(Input::get('email'))->subject('Paint Buddy Promotion');
});
$rp = DB::table('regpromotion')->insert(array('fname' => $fname, 'lname' => $lname, 'email' => $email, 'contact_number' => $cno, 'address' => $address, 'promotionID' => $prokey, 'cid' => $cid1));
return view('pages\\Discount\\registerpromotion', ['rp' => $rp, 'nm' => $nm, 'lnm' => $lnm, 'ad' => $ad, 'mail' => $mail, 'phone' => $phone, 'rid' => $rid])->withErrors($validate2);
}
示例6: store
/**
* Store a newly created resource in storage.
*
* @param Request $request
* @return Response
*/
public function store(Request $request)
{
$input = input::all();
CompanyStructure::create($input);
return Redirect::route('admin.setup.company.structures.index')->withFlashSuccess('Company structure data was successfully created.');
}
示例7: save_announcement
public function save_announcement(Request $request)
{
if (!Auth::user() || Auth::user()->role != 1) {
return redirect('/');
}
$rules = array('term' => 'required', 'field' => 'required', 'region' => 'required', 'month' => 'required');
$messages = array('term.required' => 'სწავლების ფორმა სავალდებულოა', 'field.required' => 'სწავლების სფერო სავალდებულოა', 'region.required' => 'ჩატარების ადგილი სავალდებულოა', 'month.required' => 'ჩატარების პერიოდი სავალდებულოა');
$input = input::all();
$file = Input::file('file');
if (isset($file) && !empty($file)) {
$extension = $file->getClientOriginalExtension();
if ($extension != 'pdf') {
$rules['pdf'] = 'required';
$messages['pdf.required'] = 'დასაშვებია მხოლოდ pdf გაფართოების ფაილები';
}
}
$this->validate($request, $rules, $messages);
if (isset($file) && !empty($file)) {
$file_name = str_random(10) . '.' . $file->getClientOriginalExtension();
$destinationPath = 'training_pdf';
$file->move($destinationPath, $file_name);
$input['file'] = $file_name;
}
$training_to_delete = Training::find(input::get('id'));
$training_to_delete->delete();
$training = Training::create($input);
foreach (input::get('term') as $term) {
$training->terms()->attach($term);
}
$training->fields()->attach(input::get('field'));
$training->municipalities()->attach(input::get('municipalities'));
if (!is_null(input::get('month'))) {
foreach (input::get('month') as $month) {
$training->months()->attach($month);
}
}
$training->save();
return redirect('/');
}
示例8: update
/**
* Update the specified resource in storage.
*
* @param int $id
* @return Response
*/
public function update($id)
{
$rules = array('name' => 'required', 'email' => 'required|email', 'address' => 'required', 'phone' => 'required|numeric');
$validator = Validator::make(input::all(), $rules);
if ($validator->fails()) {
$messages = $validator->messages();
return Redirect::to('fake/' . $id . '/edit')->withErrors($validator)->with(Input::except('_token'));
} else {
$fake = Fake::find($id);
$fake->name = Input::get('name');
$fake->email = Input::get('email');
$fake->phone = Input::get('phone');
$fake->address = Input::get('address');
$fake->save();
Session::flash('message', 'Fake data successfully update');
return Redirect::to('fake');
}
}
示例9: function
return View::make('post')->with('post', $oPost);
});
Route::get('users/new', function () {
return View::make('newUserForm');
});
Route::get('users/{id}/edit', function ($id) {
$oUser = User::find($id);
return View::make('editUserForm')->with('user', $oUser);
});
Route::put('users/{id}', function ($id) {
$aRules = array('firstname' => 'required', 'lastname' => 'required', 'email' => 'required|email|unique:users,email,' . $id);
$oValidator = Validator::make(Input::all(), $aRules);
if ($oValidator->passes()) {
//update user details
$oUser = User::find($id);
$oUser->fill(input::all());
$oUser->save();
return Redirect::to('users/' . $id);
} else {
return Redirect::to('users/' . $id . 'edit')->withErrors($oValidator)->withInput();
}
})->before("auth");
Route::post('users', function () {
//validate input
$aUserInput = Input::All();
$aRules = array('username' => 'required|unique:users', 'password' => 'Confirmed|required', 'password_confirmation' => 'required', 'firstname' => 'required', 'lastname' => 'required', 'email' => 'required|unique:users');
$oValidator = Validator::make($aUserInput, $aRules);
if ($oValidator->fails()) {
return Redirect::to('users/new')->withErrors($oValidator)->withInput();
} else {
$aDetails = Input::All();
示例10: update
/**
* Update the specified resource in storage.
*
* @param \Illuminate\Http\Request $request
* @param int $id
* @return \Illuminate\Http\Response
*/
public function update(Request $request, $id)
{
$currentfile = table_media_manager::find($id);
$currentfile = $currentfile->media_manager_filename;
// $dataUpdate = Request::all();
// $data = table_media_manager::find($id);
// $data->update($dataUpdate);
// return redirect('admin/media-manager')->with('message', 'Data successfully changed!');
$title = input::get('media_manager_title');
$publish = input::get('media_manager_publish');
$link = input::get('media_manager_link');
if (Input::hasFile('file')) {
$rules = array('file' => 'mimes:pdf,png,jpeg,jpg,bmp,doc,docx,xls,xlsx,csv,mp4,mp3,flv,');
$validator = Validator::make(input::all(), $rules);
if ($validator->fails()) {
return redirect('admin/media-manager')->with('failed', 'file that allowed to upload are pdf, png, jpeg, jpg, bmp, doc, docx, xls, xlsx, csv, mp4, mp3, or flv ');
} else {
$file = Input::file('file');
$filename = date("Y-m-d") . '-' . str_random(8) . '-' . $file->getClientOriginalName();
$destinationPath = 'UPLOADED';
$file->move($destinationPath, $filename);
$type = $file->getClientOriginalExtension();
$dataUpdate = array('media_manager_title' => $title, 'media_manager_type' => $type, 'media_manager_filename' => $filename, 'media_manager_publish' => $publish);
$data = table_media_manager::find($id);
$data->update($dataUpdate);
if (file_exists('./UPLOADED/' . $currentfile)) {
unlink('./UPLOADED/' . $currentfile);
}
}
} elseif ($link != '') {
$dataUpdate = array('media_manager_title' => $title, 'media_manager_type' => 'url', 'media_manager_filename' => $link, 'media_manager_publish' => $publish);
$data = table_media_manager::find($id);
$data->update($dataUpdate);
if (file_exists('./UPLOADED/' . $currentfile)) {
unlink('./UPLOADED/' . $currentfile);
}
} else {
$dataUpdate = array('media_manager_title' => $title, 'media_manager_publish' => $publish);
$data = table_media_manager::find($id);
$data->update($dataUpdate);
return redirect('admin/media-manager')->with('warning', 'Data successfully changed, You did not change the resource!');
}
return redirect('admin/media-manager')->with('success', 'Data successfully changed');
}
示例11: upload_media
public function upload_media()
{
$app = app();
if (Request::has('token')) {
$token = Request::input('token', '');
$compare = GlobalLibrary::tokenExtractor($token);
$users_checker = GlobalLibrary::CheckUsersToken($compare);
//echo '<pre>'.print_r($compare).'</pre>';
if ($users_checker[0]) {
$uname = $users_checker[1];
$uid = $users_checker[2];
$email = $users_checker[3];
$title = Request::input('ttl');
$publish = Request::input('pub');
$link = Request::input('lnk');
if (Request::input('file')) {
$rules = array('file' => 'mimes:pdf,png,jpeg,jpg,bmp,doc,docx,xls,xlsx,csv,mp4,mp3,flv,');
$validator = Validator::make(input::all(), $rules);
if ($validator->fails()) {
return redirect('admin/media-manager')->with('failed', 'file that allowed to upload are pdf, png, jpeg, jpg, bmp, doc, docx, xls, xlsx, csv, mp4, mp3, or flv ');
} else {
$file = Input::file('file');
$filename = date("Y-m-d") . '-' . str_random(8) . '-' . $file->getClientOriginalName();
$destinationPath = 'UPLOADED';
$file->move($destinationPath, $filename);
$type = $file->getClientOriginalExtension();
$field_media_manager = array('media_manager_title' => $title, 'media_manager_type' => $type, 'media_manager_filename' => $filename, 'media_manager_publish' => $publish);
$media = table_media_manager::create($field_media_manager);
}
} else {
if ($link != '') {
$type = 'url';
$field_media_manager = array('media_manager_title' => $title, 'media_manager_type' => $type, 'media_manager_filename' => $link, 'media_manager_publish' => $publish);
$media = table_media_manager::create($field_media_manager);
} else {
return (new Response(array('status' => true, 'msg' => 'Failed, you did not select file to upload'), 200))->header('content-Type', "json");
}
}
$file[0] = $media->media_manager_id;
$file[1] = $title;
$file[2] = $type;
$file[3] = $link;
return (new Response(array('status' => true, 'data' => $dataConverted), 200))->header('Content-Type', "json");
} else {
return (new Response(array('status' => false, 'msg' => 'Authentication Failed2'), 200))->header('content-Type', "json");
}
} else {
return (new Response(array('status' => false, 'msg' => 'Authentication Failed1'), 200))->header('content-Type', "json");
}
}