当前位置: 首页>>代码示例>>PHP>>正文


PHP Redirect::Route方法代码示例

本文整理汇总了PHP中Redirect::Route方法的典型用法代码示例。如果您正苦于以下问题:PHP Redirect::Route方法的具体用法?PHP Redirect::Route怎么用?PHP Redirect::Route使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Redirect的用法示例。


在下文中一共展示了Redirect::Route方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: login

 public function login()
 {
     $data = Input::all();
     $log = Auth::attempt(array('email' => $data['email'], 'password' => $data['password']));
     if ($log) {
         $search = $data['password'];
         $data = Result::where('regno', $search)->get();
         $count = Count($data);
         return View::make('StudentReport')->with('results', $data);
     } else {
         return Redirect::Route('home')->with('fail', 'Bad combination of username and password');
     }
 }
开发者ID:KornelMbele,项目名称:ResultSystem,代码行数:13,代码来源:UserLoginController.php

示例2: recycleBin

 public function recycleBin($task)
 {
     //put the task into the recycle bin
     if (Auth::check()) {
         $id = $task;
         Task::destroy($id);
         if (Auth::user()->admin == 'true') {
             $deletedTasks = Task::onlyTrashed()->paginate(5);
             return Redirect::Route('tasks.index', ['deletedTasks' => $deletedTasks]);
         }
     }
     return Redirect::route('tasks.index');
 }
开发者ID:gerry411,项目名称:MatasTasklist,代码行数:13,代码来源:TasksController.php

示例3: visitSummaryEntry

 /**
  * Show the form for creating a new resource.
  * GET /nurse/create
  */
 public function visitSummaryEntry()
 {
     $destinationPath = public_path('retinal_image/');
     $link_address = "/view/patients_managment/visitSummary";
     $patient_id = null;
     $rules = ['patient_id' => 'required', 'patient_name' => 'required', 'height' => 'required', 'weight' => 'required', 'bp' => 'required'];
     $data = Input::all();
     $validator = Validator::make(Input::all(), $rules);
     if ($validator->fails()) {
         return Redirect::back()->withErrors($validator);
     } else {
         if (!Input::hasFile('retinal_image')) {
             return Redirect::back()->withErrors("Image is required");
         } else {
             $photo_fileName = null;
             if (Input::hasFile('retinal_image')) {
                 $photo = Input::file('retinal_image');
                 $photo_fileName = strtotime(date('Y-m-d H:i:s')) . md5($photo->getClientOriginalName()) . "." . $photo->getClientOriginalExtension();
                 $photo->move($destinationPath, $photo_fileName);
             }
             $visitSummary = new Visitsummary();
             $visitSummary->patient_id = $data['patient_id'];
             $visitSummary->patient_name = $data['patient_name'];
             $visitSummary->height = $data['height'];
             $visitSummary->weight = $data['weight'];
             $visitSummary->bp = $data['bp'];
             $visitSummary->retinal_image = $photo_fileName;
             if ($visitSummary->save()) {
                 $patient_id = $visitSummary->id;
                 return Redirect::Route('nurse_dashboard')->with('success', 'Successfully Updated');
             } else {
                 return Redirect::back()->withErrors("Something Went Wrong. Try Again.");
             }
         }
     }
 }
开发者ID:Nishikanto,项目名称:Website,代码行数:40,代码来源:NurseController.php

示例4: getFMWalkin

 public function getFMWalkin()
 {
     if (Auth::User()->isAdmin()) {
         return View::make('reservation.fm_walkin');
     } else {
         return Redirect::Route('home');
     }
 }
开发者ID:jhunel2389,项目名称:baeyaya-dev,代码行数:8,代码来源:FileMaintenanceController.php

示例5: signup

 public function signup()
 {
     $name = Input::get('name');
     $pwd = Input::get('password');
     $pwd_verify = Input::get('password_verify');
     $ldap = Input::get('ldap');
     $ldap = explode('@', $ldap)[0];
     $ldap = $ldap . "@iitb.ac.in";
     $email = Input::get('email');
     // $captcha=Input::get('g-recaptcha-response');
     $messageBag = new MessageBag();
     $bag_empty = true;
     // echo $captcha;
     // // To incorporate captcha
     // $url = 'https://www.google.com/recaptcha/api/siteverify';
     // $data = array('secret' => '6LeQbA0TAAAAAGj7pDd26ghKX_LyotrYw8ABD48o', 'response' => $captcha);
     // // use key 'http' even if you send the request to https://...
     // $options = array(
     //   		'http' => array(
     //         'header'  => "Content-type: application/x-www-form-urlencoded\r\n",
     //         'method'  => 'POST',
     //         'content' => http_build_query($data),
     //     ),
     // );
     // $context  = stream_context_create($options);
     // $result = file_get_contents($url, false, $context);
     //    	echo $result;
     //    	return;
     //    	$result = json_decode($result);
     // if($result->success=='false'){
     // 	$messageBag->add('message',"Wrong Captcha");
     // 	$bag_empty = false;
     // }
     if ($name == "") {
         $messageBag->add('message', "Please enter Name");
         $bag_empty = false;
     }
     if ($pwd == "") {
         $messageBag->add('message', "Please enter Password");
         $bag_empty = false;
     }
     if ($ldap == "") {
         $messageBag->add('message', "Please enter LDAP ID");
         $bag_empty = false;
     }
     if ($email == "") {
         $messageBag->add('message', "Please enter Email");
         $bag_empty = false;
     }
     // if (strlen($_POST["password"]) < '8' || strlen($_POST["password"]) > '20') {
     // 	$messageBag->add('message',"Password Must Contain At Least 8 and At Most 20 Characters" );
     // 	$bag_empty = false;
     //    }
     if (!preg_match("/^[a-zA-Z ]*\$/", $name)) {
         $messageBag->add('message', "Only letters and white space allowed in Name");
         $bag_empty = false;
     }
     if (!filter_var($ldap, FILTER_VALIDATE_EMAIL)) {
         $messageBag->add('message', "Please enter valid LDAP ID");
         $bag_empty = false;
     }
     if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
         $messageBag->add('message', "Please enter valid Email");
         $bag_empty = false;
     }
     if ($pwd != $pwd_verify) {
         $messageBag->add('message', "Passwords do not Match");
         $bag_empty = false;
     }
     if (!$bag_empty) {
         return Redirect::back()->with('messages', $messageBag);
     }
     $users = User::where('ldap_email', '=', $ldap)->get();
     if (sizeof($users) == 0) {
         $user = new User();
         $user->other_email = $email;
         $user->name = $name;
         $user->password = sha1($pwd);
         $user->ldap_email = $ldap;
         $user->save();
         Auth::login($user);
         return Redirect::Route('user.profile');
         $gpo_id = $ldap;
         $gpo_id = explode('@', $gpo_id)[0];
         $user = Auth::User();
         //var_dump($user);
         $key = 'Prateek';
         $string = $user->id;
         $user->ldap_email = $gpo_id . "@iitb.ac.in";
         User::where('id', '=', $string)->update(array('ldap_email' => $gpo_id . '@iitb.ac.in'));
         $encrypted = base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, md5($key), $string, MCRYPT_MODE_CBC, md5(md5($key))));
         $decrypted = rtrim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, md5($key), base64_decode($encrypted), MCRYPT_MODE_CBC, md5(md5($key))), "");
         //var_dump($encrypted);
         //var_dump($decrypted);
         //echo $gpo_id;
         try {
             Mail::send('email.verifygpo', ['key' => URL::Route('user.profile') . '?key=' . urlencode($encrypted), 'name' => $user->Name], function ($message) use($user) {
                 $message->to($user->ldap_email, $user->Name)->subject('Verify Stab Id');
             });
             $messageBag_new = new MessageBag();
//.........这里部分代码省略.........
开发者ID:kushalbabel,项目名称:mainsite,代码行数:101,代码来源:UserController.php

示例6: tutorials_upload

 public function tutorials_upload()
 {
     if (Auth::check()) {
         if (Auth::User()->ldap_verified == 0) {
             $messageBag = new MessageBag();
             $messageBag->add('message', "Please Verify Your GPO ID before Uploading a Tutorial");
             return Redirect::Route('user.profile')->with('messages', $messageBag)->withInput();
         } else {
             return View::make('tutorials_upload');
         }
     } else {
         $messageBag = new MessageBag();
         $messageBag->add('message', 'Please Login before Uploading a Tutorial');
         return Redirect::to('login_page')->with('messages', $messageBag)->withInput();
     }
 }
开发者ID:kushalbabel,项目名称:mainsite,代码行数:16,代码来源:HomeController.php

示例7: array

Route::get('redirect-asignar-profesores', array('as' => 'redirect-asignar-profesores', function () {
    $datos = Input::all();
    $id = $datos['id'];
    $nombre = $datos['nombre'];
    $profesores = Usuario::all();
    $profesores2 = Usuario::where('nombre', 'ILIKE', '%' . $nombre . '%')->get();
    $curso = Curso::find($id);
    return Redirect::Route('crear-curso-4', array($id, $nombre));
}));
//Ruta para redireccionar los contenidos creados en el administrador
Route::get('redirect-temario-curso', array('as' => 'redirect-temario-curso', function () {
    $datos = Input::all();
    $id = $datos['id_curso'];
    $tipo_contenido = $datos['tipo_contenido'];
    $curso = Curso::find($id);
    return Redirect::Route('crear-curso-5', array($id));
}));
//Ruta para asignar profesor a un curso
Route::get('asignar-profesor/{id_curso}/{id_usuario}/{tipo}', array('as' => 'asignar-profesor', function ($id_curso, $id_usuario, $tipo) {
    DB::table('relacion_usuario_curso')->insert(array('id_usuario' => $id_usuario, 'id_curso' => $id_curso, 'tipo_relacion' => $tipo, 'fecha_creacion' => date('Y-m-d H:i:s'), 'estado' => 'activo'));
    return Redirect::route('crear-curso-3', $id_curso);
}))->where('id_curso', '[0-9]+');
//Ruta para eliminar una asignacion de profesor a un curso
Route::get('desasignar-profesor/{id_curso}/{id_usuario}/{tipo}', array('as' => 'desasignar-profesor', function ($id_curso, $id_usuario, $tipo) {
    RelacionUsuarioCurso::where('tipo_relacion', '=', $tipo)->where('id_usuario', '=', $id_usuario)->where('id_curso', '=', $id_curso)->delete();
    return Redirect::route('crear-curso-3', $id_curso);
}))->where('id_curso', '[0-9]+');
Route::resource('curso', 'CursoController');
Route::resource('usuario', 'UsuarioController');
Route::resource('evaluacion', 'EvaluacionController');
Route::resource('leccion', 'LeccionController');
开发者ID:informaticaeducativa,项目名称:moocucc,代码行数:31,代码来源:routes.php

示例8: postCategory

 public function postCategory()
 {
     $validation = \Post::validate(\Input::all());
     $input = \Input::all();
     if ($validation->fails()) {
         if ($input['type'] == "page") {
             return \Redirect::Route("addnewpage")->withErrors($validation)->withInput();
         } elseif ($input['type'] == "post") {
             return \Redirect::Route("addnewpost")->withErrors($validation)->withInput();
         } elseif ($input['type'] == "category") {
             return \Redirect::Route("listcat")->withErrors($validation)->withInput();
         }
     } else {
         $post = new \Post();
         $post->title = $input['title'];
         $post->p_content = $input['p_content'];
         $post->permalink = $input['permalink'];
         $post->type = $input['type'];
         $post->created_by = "Admin";
         //var_dump($post);
         try {
             $post = $post->save();
             return '<div class="alert alert-success fade in">
                                     <button class="close" data-dismiss="alert">×</button>
                                     <i class="fa-fw fa fa-times">Category created"</div>';
             // $redirect = (isset($input['form_save'])) ? "backend/{$input['type']}s" : "backend/{$input['type']}s/create";
             //return \Redirect::to($redirect)
             // ->with('success_message', 'The ' . $this->type . ' was created.');
         } catch (ValidationException $e) {
             return "Unexpected Error! Category not created";
             // \Redirect::back()->withInput()->withErrors($e->getErrors());
         }
     }
 }
开发者ID:runningjack,项目名称:auctionsite,代码行数:34,代码来源:HomeController.php

示例9: deletecik

 public function deletecik($id)
 {
     $cik = Cik::where('id', $id)->delete();
     return Redirect::Route('cikFree');
 }
开发者ID:Sighillrob,项目名称:IoT-All,代码行数:5,代码来源:AdminController.php

示例10: saveNewProfile

 public function saveNewProfile()
 {
     $id = Auth::user()->id;
     $profile = UserProfile::firstOrNew(array('id' => $id));
     $profile->fname = Input::get('fname');
     $profile->lname = Input::get('lname');
     $profile->streetno = Input::get('streetno');
     $profile->street = Input::get('street');
     $profile->suburb = Input::get('suburb');
     $profile->postcode = Input::get('postcode');
     $profile->state = Input::get('state');
     $profile->day_dob = Input::get('day_dob');
     $profile->month_dob = Input::get('month_dob');
     $profile->year_dob = Input::get('year_dob');
     $profile->phone = Input::get('phone');
     $profile->tfn = Input::get('tfn');
     $profile->pidtype = Input::get('pidtype');
     $profile->pidnum = Input::get('pidnum');
     $profile->sidtype = Input::get('sidtype');
     $profile->sidnum = Input::get('sidnum');
     $profile->description = Input::get('description');
     $profile->gender = Input::get('gender');
     $profile->occupation = Input::get('occupation');
     $profile->currency = 'AUD';
     $profile->save();
     $user = User::where('id', '=', $id)->first();
     $user->profile_complete = 1;
     $user->save();
     return Redirect::Route('profile');
 }
开发者ID:Clare-E-Rich,项目名称:DECO7381_MoneyLink_GroupProject,代码行数:30,代码来源:UserProfileController.php


注:本文中的Redirect::Route方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。