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


PHP Redirect::to_route方法代码示例

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


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

示例1: post_create_document

 public function post_create_document()
 {
     $document_id = Input::get('document_id');
     $user_id = Auth::user()->id;
     // we want to get all the input data
     //
     // take apart the name and value pairs
     //
     $inputs = Input::all();
     //dd($inputs);
     foreach (Input::all() as $name => $value) {
         if ($name != '0' || $name != 'csrf_token') {
             // for some reason, laravel id=gnores form fields with nums as
             // the name value so this will fix it
             //  along with the <input name="id45"..
             $name = str_replace('id', '', $name);
             Answer::create(array('document_id' => $document_id, 'user_id' => $user_id, 'field_id' => $name, 'answer' => $value));
         }
         // dd(array(
         //     'document_id' => $document_id,
         //     'user_id' => $user_id,
         //     'field_id' => $key,
         //     'answer' => $value
         // ));
     }
     return Redirect::to_route('tenant_view_document', $document_id);
 }
开发者ID:andyfoster,项目名称:tenantplus,代码行数:27,代码来源:tenants.php

示例2: get_erase

 public function get_erase($id)
 {
     $success = "User deleted with success!";
     $user = User::find($id);
     $user->delete();
     return Redirect::to_route('dojo::index_user')->with('success', $success);
 }
开发者ID:SerdarSanri,项目名称:Dojo,代码行数:7,代码来源:user.php

示例3: home

 public function home()
 {
     // belum login
     if (Auth::guest()) {
         return Redirect::to_route('login');
     }
     // sudah login
     return Request::ajax() ? View::make('pages.home') : View::make('layout');
 }
开发者ID:udibagas,项目名称:digilib,代码行数:9,代码来源:AdminController.php

示例4: post_multi_page_example_two

 public function post_multi_page_example_two()
 {
     $fields = array('street_address', 'suite_number', 'favorite_foods');
     if (!ExampleForm::is_valid($fields)) {
         return Redirect::back()->with_input()->with_errors(ExampleForm::$validation);
     }
     ExampleForm::save_input($fields);
     return Redirect::to_route('form_examples', array('multi_page_example_review'));
 }
开发者ID:gigikiri,项目名称:masjid-l3,代码行数:9,代码来源:examples.php

示例5: delete_destroy

 public function delete_destroy()
 {
     $cid = Input::get('cid');
     $pid = Input::get('pid');
     $post = Post::find($pid);
     //$post_id = Comment::find(Input::get('id'))->post->slug;
     Comment::find($cid)->delete();
     return Redirect::to_route('post_view', $post->slug)->with('message', 'Comment has been deleted Successfully!');
 }
开发者ID:reeceballano,项目名称:Mayaten-Blog,代码行数:9,代码来源:comments.php

示例6: get_logout

 /**
  * Logout dan redirect ke login form
  */
 public function get_logout()
 {
     // Trigger:
     // Sebelum logout, mengkosongkan kembali isi folder 'pdf' dan 'files' dari file-file
     // lembar disposisi yang digenerate dan CSV yang diimport.
     Printpdf::empty_pdf_folder();
     Suratkeluar::empty_csv_folder();
     Auth::logout();
     return Redirect::to_route('login')->with('title', 'Agenda Surat :: Login');
 }
开发者ID:kit9,项目名称:agenda,代码行数:13,代码来源:auth.php

示例7: testRedirectsCanBeGeneratedForNamedRoutes

 /**
  * Test the Redirect::to_route method.
  *
  * @group laravel
  */
 public function testRedirectsCanBeGeneratedForNamedRoutes()
 {
     Route::get('redirect', array('as' => 'redirect'));
     Route::get('redirect/(:any)/(:any)', array('as' => 'redirect-2'));
     Route::get('secure/redirect', array('https' => true, 'as' => 'redirect-3'));
     $this->assertEquals(301, Redirect::to_route('redirect', array(), 301, true)->status());
     $this->assertEquals('http://localhost/redirect', Redirect::to_route('redirect')->headers()->get('location'));
     $this->assertEquals('https://localhost/secure/redirect', Redirect::to_route('redirect-3', array(), 302)->headers()->get('location'));
     $this->assertEquals('http://localhost/redirect/1/2', Redirect::to_route('redirect-2', array('1', '2'))->headers()->get('location'));
 }
开发者ID:gilyaev,项目名称:framework-bench,代码行数:15,代码来源:redirect.test.php

示例8: action_do_create

 public function action_do_create()
 {
     $v = Customer::validate(Input::all());
     if ($v->fails()) {
         return Redirect::to_route('create_customer')->with('user', Auth::user())->with_errors($v)->with_input();
     }
     $new_customer = array('name' => Input::get('name'), 'description' => Input::get('description'), 'organization_id' => Auth::user()->organization->id);
     $customer = new Customer($new_customer);
     $customer->save();
     return Redirect::to_route('customers');
 }
开发者ID:nigobo,项目名称:laravel-play,代码行数:11,代码来源:customer.php

示例9: get_logout

 public function get_logout()
 {
     if (Auth::check()) {
         Auth::logout();
         Session::flush();
         //delete the session
         return Redirect::to_route('home')->with('message', 'Logged out');
     } else {
         return Redirect::to_route('home');
     }
 }
开发者ID:andyfoster,项目名称:tenantplus,代码行数:11,代码来源:users.php

示例10: delete_destroy

 public function delete_destroy()
 {
     $id = Input::get('id');
     //*Note: Make sure to set post_id as your foreign key.
     //*Note: Set ON DELETE CASCADE in your comments table
     Post::find($id)->delete();
     //*Info: Incase you didn't set your comments table "ON DELETE CASCADE", just the code below.
     //Post::find($id)->comments()->delete();
     //Post::find($id)->delete();
     return Redirect::to_route('posts')->with('message', 'Post has been deleted successfully!');
 }
开发者ID:reeceballano,项目名称:Mayaten-Blog,代码行数:11,代码来源:posts.php

示例11: put_update

 public function put_update()
 {
     $id = Input::get('id');
     // validasi input apakah sesuai rules (cek di model "suratmasuk")
     $validation = Suratmasuk::validate_alt(Input::all());
     if ($validation->fails()) {
         return Redirect::to_route('edit_suratmasuk', $id)->with_errors($validation);
     } else {
         $update_surat = Suratmasuk::update_surat($id);
         return Redirect::to_route('suratmasuk', $id)->with('message', $update_surat);
     }
 }
开发者ID:kit9,项目名称:agenda,代码行数:12,代码来源:suratmasuks.php

示例12: post_create

 public function post_create()
 {
     $user = new User();
     $user->email = Input::get('email');
     $user->password = Input::get('password');
     if ($user->save()) {
         Auth::login($user->id);
         return Redirect::to_route('user_account');
     } else {
         return Redirect::to_route('home')->with('signup_errors', $user->errors->all())->with_input('only', array('email'));
     }
 }
开发者ID:netcon-source,项目名称:clementia,代码行数:12,代码来源:user.php

示例13: action_create

 public function action_create()
 {
     $project = Project::find(Input::get('project_id'));
     if (!$project || !$project->question_period_is_open()) {
         return Redirect::to_route('project', $project->id);
     }
     $question = new Question(array('project_id' => Input::get('project_id'), 'question' => Input::get('question')));
     $question->vendor_id = Auth::user()->vendor->id;
     if ($question->validator()->passes()) {
         $question->save();
         return Response::json(array("status" => "success", "question" => $question->to_array(), "html" => View::make('projects.partials.question')->with('question', $question)->render()));
     } else {
         return Response::json(array("status" => "error", "errors" => $question->validator()->errors->all()));
     }
 }
开发者ID:ajb,项目名称:rfpez,代码行数:15,代码来源:questions.php

示例14: action_do_create

 public function action_do_create()
 {
     $project = Project::find(Input::get('project_id'));
     $new = array('title' => Input::get('title'), 'description' => Input::get('description'), 'customer_id' => $project->customer_id, 'project_id' => $project->id, 'organization_id' => Auth::user()->organization->id);
     $v = Todo::validate($new);
     if ($v->fails()) {
         // redirect back to the form with
         // errors, input and our currently
         // logged in user
         return Redirect::to_route('create_todo', $project->id)->with_errors($v)->with_input();
     }
     // create the new post
     $o = new Todo($new);
     $o->save();
     // redirect to viewing our new post
     return Redirect::to_route('read_customer', $project->customer_id);
 }
开发者ID:nigobo,项目名称:laravel-play,代码行数:17,代码来源:todo.php

示例15: get_add

 function get_add($id = null)
 {
     if ($this->in('clear', false)) {
         $this->input = array();
         return $this->get_clear();
     }
     $single = $this->addGetSingle($id);
     if ($single === true) {
         $this->status('add_many');
     } elseif ($single !== null) {
         $this->status(Cart::has($single) ? 'add_one' : 'remove', $single->to_array());
     }
     if ($this->in('checkout', null)) {
         return Redirect::to_route('vanemart::checkout');
     } else {
         return $this->back();
     }
 }
开发者ID:SerdarSanri,项目名称:VaneMart,代码行数:18,代码来源:Cart.php


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