本文整理汇总了PHP中Redirect::to方法的典型用法代码示例。如果您正苦于以下问题:PHP Redirect::to方法的具体用法?PHP Redirect::to怎么用?PHP Redirect::to使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Redirect
的用法示例。
在下文中一共展示了Redirect::to方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: authenticate
/**
* Call this method to redirect user to login page and initiate
* the Web Server OAuth Authentication Flow.
* @return void
*/
public function authenticate($loginURL = null)
{
if (!isset($loginURL)) {
$loginURL = $this->credentials['loginURL'];
}
$loginURL .= '/services/oauth2/authorize';
$loginURL .= '?response_type=code';
$loginURL .= '&client_id=' . $this->credentials['consumerKey'];
$loginURL .= '&redirect_uri=' . urlencode($this->credentials['callbackURI']);
if ($this->parameters['display'] != '') {
$loginURL .= '&display=' . $this->parameters['display'];
}
if ($this->parameters['immediate']) {
$loginURL .= '&immediate=true';
}
if ($this->parameters['state'] != '') {
$loginURL .= '&state=' . urlencode($this->parameters['state']);
}
if ($this->parameters['scope'] != '') {
$scope = rawurlencode($this->parameters['scope']);
$loginURL .= '&scope=' . $scope;
}
if ($this->parameters['prompt'] != '') {
$prompt = rawurlencode($this->parameters['prompt']);
$loginURL .= '&prompt=' . $prompt;
}
return $this->redirect->to($loginURL);
}
示例2: delete
public function delete()
{
$error = false;
if (Input::has("del-gpId")) {
if (CRUtilities::deleteGP(Input::get("del-gpId"))) {
return Redirect::to("admin/dashboard/gateway")->with("message", "Gateway Profile has been deleted.");
} else {
$error = true;
}
} else {
if (Input::has("rem-crId")) {
if (CRUtilities::deleteCR(Input::all())) {
return Redirect::to("admin/dashboard/gateway")->with("message", "The selected Compute Resource has been successfully removed");
} else {
$error = true;
}
} else {
if (Input::has("rem-srId")) {
if (CRUtilities::deleteSR(Input::all())) {
return Redirect::to("admin/dashboard/gateway")->with("message", "The selected Compute Resource has been successfully removed");
} else {
$error = true;
}
} else {
$error = true;
}
}
}
if ($error) {
return Redirect::to("admin/dashboard/gateway")->with("message", "An error has occurred. Please try again later or report a bug using the link in the Help menu");
}
}
示例3: postNueva
public function postNueva()
{
$oferta = new Oferta();
$data = Input::all();
$titulaciones = Input::get('titulaciones');
unset($data['titulaciones']);
$data['fecha_caducidad'] = DateSql::changeToSql($data['fecha_caducidad']);
//return var_dump($data);
$oferta->fill($data);
$oferta->save();
if (is_array($titulaciones)) {
foreach ($titulaciones as $titulacion) {
$oferta->titulaciones()->attach($titulacion);
}
}
/*if (Input::has('titulaciones'))
{
foreach(Input::get('titulaciones') as $titulacion) {
$titulaciones[]=new Titulacion(array('empresa_id'=>Session::get('id_empresa'), 'titulacion'=>$titulacion));
}
$oferta->titulaciones()->saveMany($titulaciones);
}
if (Input::has('funciones_esp')) {
foreach(Input::get('funciones_esp') as $funcion) {
$funciones[]=new FuncionOferta(array('funcion'=>$funcion));
}
$oferta->funciones()->saveMany($funciones);
}*/
return Redirect::to('oferta/ficha-oferta/' . $oferta->id . "#requerimientos")->with('ok', "Oferta creada con éxito.");
}
示例4: faqSend
public function faqSend()
{
$question = new Question();
$input = Input::all();
$captcha_string = Input::get('g-recaptcha-response');
$captcha_response = file_get_contents('https://www.google.com/recaptcha/api/siteverify?secret=6LcCwgATAAAAAKaXhPJOGPTBwX-n2-PPLZ7iupKj&response=' . $captcha_string);
$captcha_json = json_decode($captcha_response);
if ($captcha_json->success) {
$rules = ["sujetQuestion" => "required", "mail" => "required|email", "contenuQuestion" => "required"];
$messages = ["required" => ":attribute est requis pour l'envoi d'une question", "email" => "L'adresse email précisée n'est pas valide"];
$validator = Validator::make(Input::all(), $rules, $messages);
if ($validator->fails()) {
$messages = $validator->messages();
Session::flash('flash_msg', "Certains champs spécifiés sont incorrects.");
Session::flash('flash_type', "fail");
return Redirect::to(URL::previous())->withErrors($validator);
} else {
$question->fill($input)->save();
Session::flash('flash_msg', "Votre question nous est bien parvenue. Nous vous répondrons sous peu.");
Session::flash('flash_type', "success");
return Redirect::to(URL::previous());
}
} else {
Session::flash('flash_msg', "Champ de vérification incorrect ou non coché.");
Session::flash('flash_type', "fail");
return Redirect::to(URL::previous());
}
}
示例5: index
/**
* Display a listing of the resource.
*
* @return Response
*/
public function index()
{
if (Auth::check()) {
return Redirect::to('admin/panelAdmin');
}
return View::make('admin/login');
}
示例6: do_save
function do_save()
{
$ids = Input::get('ids');
$customer_first_name = Input::get('customer_first_name');
$customer_last_name = Input::get('customer_last_name');
$customer_company = Input::get('customer_company');
$customer_address = Input::get('customer_address');
$customer_town = Input::get('customer_town');
$customer_country = Input::get('customer_country');
$customer_email = Input::get('customer_email');
$customer_phone = Input::get('customer_phone');
$customer_datebirth = Input::get('customer_datebirth');
$customer_password = Input::get('password');
if ($customer_password != "") {
$save['customer_password'] = $customer_password;
}
$save['customer_first_name'] = $customer_first_name;
$save['customer_last_name'] = $customer_last_name;
$save['customer_company'] = $customer_company;
$save['customer_address'] = $customer_address;
$save['customer_town'] = $customer_town;
$save['customer_country'] = $customer_country;
$save['customer_email'] = $customer_email;
$save['customer_phone'] = $customer_phone;
$save['customer_datebirth'] = $customer_datebirth;
$this->customer->edit($ids, $save);
Session::flash('notip', '<div class="alert alert-success">Profile telah diupdate</div>');
return Redirect::to('/member/' . $ids);
}
示例7: sendForgotPasswordEmail
/**
* Sends Forgot Password Email
* @param string
* @return bool
*/
public static function sendForgotPasswordEmail($email)
{
try {
// Find the user using the user email address
$user = Sentry::getUserProvider()->findByLogin($email);
// Get the password reset code
$resetCode = $user->getResetPasswordCode();
//send this code to your user via email.
$name = $user->first_name . ' ' . $user->last_name;
$link = (string) url() . '/auth/recoverpassword?password_reset_token=' . $resetCode . '&email=' . $email;
$data = array('name' => $name, 'link' => $link);
Mail::queue('emails.auth.forgotpassword', $data, function ($message) use($user) {
$message->to($user->email)->subject('Forgot Password Assistance');
});
return true;
} catch (Cartalyst\Sentry\Users\UserNotFoundException $e) {
return Redirect::to('login')->with('message', 'error104');
} catch (Cartalyst\Sentry\Users\UserNotActivatedException $e) {
return Redirect::to('login')->with('message', 'error103');
} catch (Cartalyst\Sentry\Users\UserSuspendedException $e) {
return Redirect::to('login')->with('message', 'error105');
} catch (Cartalyst\Sentry\Users\UserBannedException $e) {
return Redirect::to('login')->with('message', 'error102');
}
}
示例8: registrarProfesor
public function registrarProfesor()
{
$new_profesor = new Profesor();
$new_profesor->num_empleado = Input::get("num_empleado");
$new_profesor->password = Input::get("password");
$new_profesor->email = Input::get("email");
$new_datos_profesor = new DatosProfesor();
$new_datos_profesor->nombre = Input::get("nombre");
$new_datos_profesor->apellido_paterno = Input::get("apellido_paterno");
$new_datos_profesor->apellido_materno = Input::get("apellido_materno");
$new_datos_profesor->sexo = Input::get("sexo");
$new_datos_profesor->celular = Input::get("celular");
// Pequeño hack. Primero lo ponemos como archivo para validarlo, después le asignamos la ruta real para guardarlo
$new_datos_profesor->ruta = Input::file('cv');
if ($new_profesor->validate()) {
if ($new_datos_profesor->validate()) {
$nombreCV = Input::get("nombre") . "_" . Input::get("apellido_paterno") . "_" . Input::get("apellido_materno") . "_CV.pdf";
//CHECAR PORQUE NO SE CREA EL PUTO CV!!!
Input::file('cv')->move("CVs", $nombreCV);
$new_datos_profesor->ruta = "/CVs/" . $nombreCV;
//Ahora si, guardamos todo después de haberlo validado
$new_profesor->save();
$new_datos_profesor->profesor()->associate($new_profesor);
// Forzamos Save porque sabemos que no validará ruta como un string, sino como un file
$new_datos_profesor->forceSave();
return Redirect::to('/');
} else {
return Redirect::route('registro')->withErrors($new_datos_profesor->errors())->withInput();
}
} else {
$new_datos_profesor->validate();
$erroresValidaciones = array_merge_recursive($new_profesor->errors()->toArray(), $new_datos_profesor->errors()->toArray());
return Redirect::route('registro')->withErrors($erroresValidaciones)->withInput();
}
}
示例9: loginWithFacebook
public function loginWithFacebook()
{
// get data from input
$code = Input::get('code');
// get fb service
$fb = OAuth::consumer('Facebook');
// check if code is valid
// if code is provided get user data and sign in
if (!empty($code)) {
// This was a callback request from facebook, get the token
$token = $fb->requestAccessToken($code);
// Send a request with it
$result = json_decode($fb->request('/me'), true);
$message = 'Your unique facebook user id is: ' . $result['id'] . ' and your name is ' . $result['name'];
echo $message . "<br/>";
//Var_dump
//display whole array().
dd($result);
} else {
// get fb authorization
$url = $fb->getAuthorizationUri();
// return to facebook login url
return Redirect::to((string) $url);
}
}
示例10: duzenleForm
public function duzenleForm($id)
{
$data = Input::all();
$kural = array('baslik' => 'required|min:3', 'resim' => 'max:1536|required|mimes:jpeg,jpg,bmp,png,gif');
$dogrulama = \Validator::Make($data, $kural);
if (!$dogrulama->passes()) {
return \Redirect::to('admin/galeriler/duzenle/' . $id)->withErrors($dogrulama)->withInput();
} else {
if (Input::hasFile('resim')) {
$dosya = Input::file('resim');
$uzanti = $dosya->getClientOriginalExtension();
if (strlen($uzanti) == 3) {
$dosyaAdi = substr($dosya->getClientOriginalName(), 0, -4);
} else {
if (strlen($uzanti) == 4) {
$dosyaAdi = substr($dosya->getClientOriginalName(), 0, -5);
}
}
$dosyaAdi = $dosyaAdi . "_" . date('YmdHis') . '.' . $uzanti;
$path = base_path('galeriResimler/600x450/' . $dosyaAdi);
Image::make($dosya->getRealPath())->resize(600, 450)->save($path);
$path = base_path('galeriResimler/defaultSize/' . $dosyaAdi);
Image::make($dosya->getRealPath())->save($path);
$path = $dosyaAdi;
$query = DB::insert('insert into gal_resim values (null,?,?,?)', array($id, $data["baslik"], $path));
return Redirect::back();
}
}
}
示例11: create
/**
* Show the form for creating a new resource.
* GET /ob/create
*
* @return Response
*/
public function create()
{
$validate = LeaveOB::validate(Input::all());
if ($validate->passes()) {
if (Input::get('totalleaves') <= 0.0 or Input::get('totalleaves') === 'NaN') {
$message = 'Please select correct date!';
return Redirect::to('applyob')->with('error_message', $message);
} else {
$lastrow = LeaveOB::orderBy('created_at', 'desc')->first();
}
$data = new LeaveOB();
$data->employee_id = Auth::user()->employee_id;
if ($lastrow == null) {
$data->leave_id = Str::random(8);
} else {
$data->leave_id = Str::random(8) . $lastrow->id;
}
$data->days_of_leave = Input::get('totalleaves');
$data->wdays_of_leave = Input::get('totalleave');
$data->date_from = Input::get('date_from');
$data->time_from = Input::get('time_from');
$data->date_to = Input::get('date_to');
$data->time_to = Input::get('time_to');
$data->company = Input::get('company');
$data->address = Input::get('address');
$data->reason = Input::get('reason');
$data->save();
return Redirect::to('applyob')->with('message', 'Your Application for Official Business (OB) is successfully send.Please Check Your Notification box to see if your leave has been approved.');
} else {
return Redirect::to('applyob')->withErrors($validate);
}
}
示例12: show
/**
* Display the specified resource.
*
* @param string $location
* @return Response
*/
public function show()
{
$location = Input::get('location');
$type = strtolower(Input::get('type'));
$wildcardLocation = "%" . $location . "%";
if (Input::has('type')) {
$types = array('meeting-room', 'coworking', 'desk');
if (!in_array($type, $types, true)) {
return Redirect::to('/')->with('flash_message_404', "Sorry, we don't have that type of space so we brought you back home!");
}
$listings = Listing::with('thumbnail')->where('isPublic', '=', 1, "and")->where('space_type', '=', $type)->where('city', 'LIKE', $wildcardLocation)->orWhere('state', 'LIKE', $wildcardLocation)->orWhere('suburb', 'LIKE', $wildcardLocation)->orWhere('country', 'LIKE', $wildcardLocation)->orWhere('postcode', 'LIKE', $wildcardLocation)->get();
} else {
$listings = Listing::with('thumbnail')->where('isPublic', '=', 1, "and")->where('space_type', '=', $type)->where('city', 'LIKE', $wildcardLocation)->orWhere('state', 'LIKE', $wildcardLocation)->orWhere('suburb', 'LIKE', $wildcardLocation)->orWhere('country', 'LIKE', $wildcardLocation)->orWhere('postcode', 'LIKE', $wildcardLocation)->get();
}
$colNum = Listing::where('city', 'LIKE', $wildcardLocation)->orWhere('state', 'LIKE', $wildcardLocation)->orWhere('suburb', 'LIKE', $wildcardLocation)->orWhere('country', 'LIKE', $wildcardLocation)->where('isPublic', '=', '1')->count();
switch ($colNum) {
case 1:
$colNum = 12;
break;
case 2:
$colNum = 6;
break;
case 3:
$colNum = 3;
break;
}
$title = ucwords("Search: " . $type . " spaces in " . $location);
return View::make('search.results')->with('listings', $listings)->with('title', $title)->with('colNum', $colNum);
}
示例13: archive
public function archive($publicId)
{
$branch = Branch::scope($publicId)->firstOrFail();
$branch->delete();
Session::flash('message', trans('texts.archived_branch'));
return Redirect::to('company/branches');
}
示例14: store
public function store()
{
$lrm = Lrm::getInstance();
$lrm->addRoute(\Input::get('method'), \Input::get('uri'), \Input::get('action'));
$lrm->save();
return \Redirect::to("lrm");
}
示例15: getDelete
public static function getDelete()
{
$id = Input::get('id');
$mesa = Mesa::find($id);
$mesa->delete();
return Redirect::to('/mesa');
}