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


PHP URL::route方法代码示例

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


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

示例1: addItem

 public function addItem($perams = array())
 {
     $defaults = array('text' => '', 'URL' => '#', 'reference' => 0, 'parent' => false, 'weight' => 1, 'class' => '', 'children' => array(), 'icon' => '', 'attributes' => array(), 'protected' => false);
     if (isset($perams['URL']) && preg_match("#^route:(.*)\$#is", $perams['URL'], $match)) {
         if (isset($perams['protected']) && $perams['protected']) {
             $perams['protected'] = $match[1];
         }
         if ($this->entrust && \Auth::check()) {
             $roles = \Auth::user()->roles()->get();
             $allowed = true;
             foreach ($roles as $role) {
                 foreach ($role->perms as $perm) {
                     if (in_array($match[1], $perm->protected_routes)) {
                         $perams['URL'] = \URL::route($match[1]);
                         $this->items[] = array_merge($defaults, $perams);
                     }
                 }
             }
             return $this;
         } else {
             $perams['URL'] = \URL::route($match[1]);
         }
     }
     $this->items[] = array_merge($defaults, $perams);
     return $this;
 }
开发者ID:lukesnowden,项目名称:menu,代码行数:26,代码来源:MenuContainer.php

示例2: makePayment

 /**
  * Make a EWAY payment to the destined user from the main business account.
  *
  * @return void
  */
 protected function makePayment()
 {
     $receiver = Input::get('number');
     $amounttosend = Input::get('amount');
     $currency = Input::get('currency');
     $destinationProvider = Input::get('target');
     $charges = new PlatformCharges($amounttosend, $currency, $destinationProvider);
     $desc = $charges->getReceiverType($destinationProvider);
     $user = User::find(Auth::user()->id);
     $transaction = ['Customer' => ['FirstName' => Auth::user()->name, 'Street1' => 'Level 5', 'Country' => 'US', 'Mobile' => Auth::user()->number, 'Email' => Auth::user()->email], 'Items' => [['SKU' => mt_rand(), 'Description' => 'Hybrid Transfer from EWAY to ' . $desc . ' user', 'Quantity' => 1, 'UnitCost' => $charges->convertCurrency($currency, 'AUD', $charges->getDueAmount('ew', $destinationProvider)), 'Tax' => 100]], 'Options' => [['Value' => $desc], ['Value' => $receiver], ['Value' => 'AUD'], ['Value' => 0.01 * $amounttosend]], 'Payment' => ['TotalAmount' => $charges->convertCurrency($currency, 'AUD', $charges->getDueAmount('ew', $destinationProvider)) * 100, 'CurrencyCode' => 'AUD'], 'Method' => 'ProcessPayment', 'RedirectUrl' => URL::route('dashboard') . '/ewayconfirm', 'CancelUrl' => URL::route('dashboard') . '/ewaycancel', 'PartnerID' => EwayController::$_EWAY_CUSTOMER_ID, 'TransactionType' => \Eway\Rapid\Enum\TransactionType::PURCHASE, 'Capture' => true, 'LogoUrl' => 'https://izepay.iceteck.com/public/images/logo.png', 'HeaderText' => 'Izepay Money Transfer', 'Language' => 'EN', 'CustomView' => 'BootstrapCerulean', 'VerifyCustomerEmail' => true, 'Capture' => true, 'CustomerReadOnly' => false];
     try {
         $response = $this->client->createTransaction(\Eway\Rapid\Enum\ApiMethod::RESPONSIVE_SHARED, $transaction);
         //var_dump($response);
         //                echo $response->SharedPaymentUrl;
         //sleep(20);
     } catch (Exception $ex) {
         return Redirect::route('dashboard')->with('alertError', 'Debug Error: ' . $ex->getMessage());
     }
     //manage response
     if (!$response->getErrors()) {
         // Redirect to the Responsive Shared Page
         header('Location: ' . $response->SharedPaymentUrl);
         //die();
     } else {
         foreach ($response->getErrors() as $error) {
             //echo "Response Error: ".\Eway\Rapid::getMessage($error)."<br>";
             return Redirect::route('dashboard')->with('alertError', 'Error! ' . \Eway\Rapid::getMessage($error));
         }
     }
 }
开发者ID:Roc4rdho,项目名称:app,代码行数:35,代码来源:EwayController.php

示例3: postCreate

 /**
  * This function create employee
  * when data is posted from 
  * /admin/employee/create
  */
 public function postCreate()
 {
     // Check validation
     $validator = Validator::make(Input::all(), Employee::$rulesForCreate, Employee::$messages);
     // If failed then redirect to employee-create-get route with
     // validation error and input old
     if ($validator->fails()) {
         return Redirect::route('employee-create-get')->withErrors($validator)->withInput();
     }
     // If validation is not failed then create employee
     $employee = Employee::create(array('first_name' => Input::get('first_name'), 'last_name' => Input::get('last_name'), 'age' => Input::get('age'), 'gender' => Input::get('gender'), 'DOB' => DateFormat::store(Input::get('DOB')), 'present_address' => Input::get('present_address'), 'permanent_address' => Input::get('permanent_address'), 'city' => Input::get('city'), 'state' => Input::get('state'), 'country' => Input::get('country'), 'mobile_no' => Input::get('mobile_no'), 'email' => Input::get('email'), 'created_by' => Session::get('username')));
     // Also create user account for the employee
     $user = User::create(array('details_id' => $employee->id, 'username' => Input::get('username'), 'email' => $employee->email, 'user_level' => Input::get('userlevel'), 'active' => 0));
     // generate random code and password
     $password = str_random(10);
     $code = str_random(60);
     $newHashPassword = Hash::make($password);
     // Save new password and code
     $user->password_tmp = $newHashPassword;
     $user->activation_code = $code;
     if ($user->save()) {
         // Send email to the employee.
         // This email contains username,password,activation link
         Mail::send('emails.auth.activation', array('first_name' => $employee->first_name, 'last_name' => $employee->last_name, 'username' => $user->username, 'password' => $password, 'activation_link' => URL::route('activation-get', $code)), function ($message) use($user) {
             $message->to($user->email, $user->username)->subject('Confirm Activation');
         });
     }
     return View::make('adminArea.employee.create')->with('success', 'Activation link has been sent successfully');
 }
开发者ID:madiarsa,项目名称:DVD-Rental,代码行数:34,代码来源:EmployeeController.php

示例4: profileSave

 public function profileSave()
 {
     $json_request = array('status' => FALSE, 'responseText' => '', 'redirectURL' => FALSE);
     $validator = Validator::make(Input::all(), Accounts::$update_rules);
     if ($validator->passes()) {
         $post = Input::all();
         if (self::accountUpdate($post)) {
             $result = self::crmAccountUpdate($post);
             if ($result === -1) {
                 Auth::logout();
                 $json_request['responseText'] = Config::get('api.message');
                 $json_request['redirectURL'] = pageurl('auth');
                 return Response::json($json_request, 200);
             }
             $json_request['redirectURL'] = URL::route('dashboard');
             $json_request['responseText'] = Lang::get('interface.DEFAULT.success_save');
             $json_request['status'] = TRUE;
         } else {
             $json_request['responseText'] = Lang::get('interface.DEFAULT.fail');
         }
     } else {
         $json_request['responseText'] = $validator->messages()->all();
     }
     if (Request::ajax()) {
         return Response::json($json_request, 200);
     } else {
         return Redirect::route('dashboard');
     }
 }
开发者ID:Grapheme,项目名称:lipton,代码行数:29,代码来源:participant.controller.php

示例5: onSend

 public function onSend($event)
 {
     $message = $event->message;
     $body = $message->getBody();
     $subject = $message->getSubject();
     $to = key($message->getTo());
     @($bcc = key($message->getBcc()));
     if (isset($bcc) && !empty($bcc) && $bcc == \Config::get('maillog.bcc')) {
     } else {
         try {
             $mailLog = MailLog::where('to', $to)->where('subject', $subject)->where('body', strip_tags($body))->firstOrFail();
             if (isset($bcc) && !empty($bcc) && $bcc == \Config::get('maillog.bcc_delay') && strtotime($mailLog['sended_at']) < strtotime('- ' . \Config::get('maillog.delay') . ' minutes')) {
                 $mailLog->sended_at = date('Y-m-d H:i:s', time());
             } else {
                 $message->setTo('null@null');
                 $message->setBody('');
                 $message->setFrom([]);
             }
             $mailLog->attempt += 1;
             $mailLog->save();
         } catch (ModelNotFoundException $e) {
             $mailLog = new MailLog();
             $mailLog->to = $to;
             $mailLog->subject = $subject;
             $mailLog->body = strip_tags($body);
             $mailLog->sended_at = date('Y-m-d H:i:s', time());
             $mailLog->save();
             $body = $body . '<img src="' . \URL::route('MailRead', $mailLog['id']) . '" height="1px" width="1px">';
             $message->setBody($body);
         }
     }
     $message->setBcc([]);
 }
开发者ID:iWedmak,项目名称:laravel-5-mail-log,代码行数:33,代码来源:MailEventListener.php

示例6: SendEmail

 public function SendEmail()
 {
     /*
      * validate the Inputs sent
      */
     $rules = array('email_cc' => "required_if:email_to,''|required_if:email_bcc,''", 'email_to' => "required_if:email_cc,''|required_if:email_bcc,''", 'email_bcc' => "required_if:email_cc,''|required_if:email_to,''", 'message' => 'required', 'subject' => 'required');
     $messages = array("required_without" => "Please select atleast one recipient", "subject.required" => "Please enter message subject", "message.required" => "Please enter message to send");
     $validator = Validator::make(Input::all(), $rules, $messages);
     $messages = $validator->messages();
     if ($validator->fails()) {
         return Redirect::to(URL::previous())->withErrors($validator)->withInput();
     } else {
         if (Conversation::saveEmail()) {
             Session::flash('_feedback', '<div class="alert alert-info alert-dismissable">
                             <i class="fa fa-info"></i>
                             <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button><b>Alert!</b>
                             Email has been successfully queued for sending</div>');
             //Helpers::uploadCampaignFile(Input::file('attachment'), $attachment_ref);
             return Redirect::to(URL::route('conversation'));
         } else {
             Session::flash('_feedback', '<div class="alert alert-info alert-dismissable">
                             <i class="fa fa-info"></i>
                             <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button><b>Alert!</b>
                             Error occured, please try again later</div>');
             return Redirect::to(URL::route('conversation'));
         }
     }
 }
开发者ID:centaurustech,项目名称:bmradi,代码行数:28,代码来源:SendEmailController.php

示例7: testDeleteFailNotAnOwner

 /**
  * @expectedException Illuminate\Database\Eloquent\ModelNotFoundException
  */
 public function testDeleteFailNotAnOwner()
 {
     $user = $this->createUser('exists@example.com');
     $pad = $user->pads()->save(new Pad(array('name' => 'pad')));
     $this->be($this->createUser('exists2@example.com'));
     $crawler = $this->client->request('POST', URL::route('pads.destroy', array('id' => $pad->id)));
 }
开发者ID:martinmayer,项目名称:notejam,代码行数:10,代码来源:PadTest.php

示例8: ajaxPlans

 public function ajaxPlans()
 {
     $arr = array();
     $plans = Plan::where('mr_id', \Auth::user()->id)->approved()->get();
     $leave = LeaveRequest::where('mr_id', \Auth::user()->id)->approved()->get();
     $i = 0;
     foreach ($plans as $singlePlan) {
         $arr[$i]['start'] = $singlePlan['date'];
         $arr[$i]['title'] = $singlePlan->comment ? $singlePlan->comment : '';
         $arr[$i]['color'] = 'black';
         $i++;
         foreach (json_decode($singlePlan['doctors']) as $singleDoctorId) {
             $color = $this->isDoctorVisited($singleDoctorId, $singlePlan['date']) == true ? 'green' : 'red';
             $url = $this->isDoctorVisited($singleDoctorId, $singlePlan['date']) != true ? \URL::route('addReport', $singleDoctorId) : NULL;
             $arr[$i]['url'] = $url;
             $arr[$i]['title'] = Customer::findOrFail($singleDoctorId)->name;
             $arr[$i]['start'] = $singlePlan['date'];
             $arr[$i]['color'] = $color;
             $i++;
         }
     }
     foreach ($leave as $singleLeave) {
         $arr[$i]['title'] = 'Holiday';
         $arr[$i]['start'] = $singleLeave['leave_start'];
         $arr[$i]['end'] = date('Y-m-d', strtotime($singleLeave['leave_end'] . "+1 days"));
         $arr[$i]['color'] = '#9b59b6';
         $arr[$i]['allDay'] = true;
         $i++;
     }
     return json_encode($arr);
 }
开发者ID:m-gamal,项目名称:crm,代码行数:31,代码来源:PlanController.php

示例9: sendWelcome

 /**
  * Send a welcome email to a user
  */
 private function sendWelcome($email, $password)
 {
     //send notification email
     return Mail::send('avalon::emails.welcome', array('email' => $email, 'password' => $password, 'link' => URL::route('home')), function ($message) use($email) {
         $message->to($email)->subject(trans('avalon::messages.users_welcome_subject'));
     });
 }
开发者ID:joshreisner,项目名称:avalon,代码行数:10,代码来源:UserController.php

示例10: forgotpasswordpost

 public function forgotpasswordpost()
 {
     Session::put('mailsend', 'we have some issue please try again');
     $validater = Validator::make(Input::all(), array('email' => 'Required|email'));
     if ($validater->fails()) {
         Redirect::route('forgot-password')->withErrors($validater)->withInput();
     } else {
         $user = User::where('email', '=', Input::get('email'));
         if ($user->count()) {
             $user = $user->first();
         }
         //generate a new code
         $code = str_random(60);
         $user->code = $code;
         //$sendcode=NULL;
         if ($user->save()) {
             $sendcode = Mail::send('emails.auth.recover', array('link' => URL::route('account-recover', $code), 'username' => $user->name), function ($message) use($user) {
                 $message->to($user->email, 'hello user')->subject('Your new Password')->from('webschool@app.com');
             });
             Session::put('mailsend', 'We have sent you an activation code on your mail. Thanx.');
             return Redirect::route('login');
             //return URL::route('account-recover').'/'.$code;
             // return 'successful';
         }
     }
     return Redirect::route('forgot-password');
 }
开发者ID:pankaja455,项目名称:WebSchool,代码行数:27,代码来源:AdminController.php

示例11: generateSitemap

 public static function generateSitemap($reGenerate = false)
 {
     // create new sitemap object
     $sitemap = App::make("sitemap");
     $sitemap->setCache('laravel.sitemap', 3600);
     if ($reGenerate) {
         Cache::forget($sitemap->model->getCacheKey());
     }
     // check if there is cached sitemap and build new only if is not
     if (!$sitemap->isCached()) {
         // add item to the sitemap (url, date, priority, freq)
         $sitemap->add(URL::to('/'), null, '1.0', 'daily');
         $categories = Category::get();
         foreach ($categories as $category) {
             $sitemap->add(URL::route('category', [$category->slug]), null, '1.0', 'daily');
         }
         // get all lists from db
         $lists = ViralList::orderBy('created_at', 'desc')->get();
         // add every post to the sitemap
         foreach ($lists as $list) {
             $sitemap->add(ListHelpers::viewListUrl($list), $list->updated_at, '1.0', 'monthly');
         }
     }
     // show your sitemap (options: 'xml' (default), 'html', 'txt', 'ror-rss', 'ror-rdf')
     return $sitemap->render('xml');
 }
开发者ID:ramialcheikh,项目名称:onepathnetwork,代码行数:26,代码来源:SitemapController.php

示例12: handleRegister

 public function handleRegister()
 {
     $validator = Validator::make(Input::all(), array('username' => 'required|unique:users|alpha_dash|min:4', 'email' => 'required|email|unique:users', 'country' => 'required', 'number' => 'required|numeric|min:9', 'password' => 'required|alpha_num|min:6', 'confirm_password' => 'required|alpha_num|same:password', 'terms' => 'required'));
     if ($validator->fails()) {
         return Redirect::route('home')->withErrors($validator)->withInput();
     } else {
         $username = Input::get('username');
         $email = Input::get('email');
         $number = Input::get('number');
         $password = Input::get('password');
         $country = Input::get('country');
         $newsletter = Input::has('newsletter') ? 1 : 0;
         //Activation code
         $code = str_random(60);
         //Account email
         try {
             Mail::send('emails.auth.registration', array('link' => URL::route('account-activate', $code), 'username' => $username), function ($message) use($email, $username) {
                 $message->to($email, $username)->subject('Account activation');
             });
             $user = User::create(array('username' => $username, 'email' => $email, 'number' => $number, 'password' => Hash::make($password), 'country' => $country, 'newsletter' => $newsletter, 'code' => $code, 'active' => 0));
             return Redirect::route('home')->with('alertMessage', 'Your account has been created! We have sent you an email to verify and activate your account.');
         } catch (Exception $ex) {
             return Redirect::route('home')->with('alertError', 'Error! ' . $ex->getMessage() . '. Please try again later');
         }
     }
 }
开发者ID:Roc4rdho,项目名称:app,代码行数:26,代码来源:AccountController.php

示例13: handle

 /**
  * Handle an incoming request.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  \Closure  $next
  * @param  string|null  $guard
  * @return mixed
  */
 public function handle($request, Closure $next, $guard = null)
 {
     if (Auth::guard($guard)->check()) {
         return redirect(\URL::route('customers'));
     }
     return $next($request);
 }
开发者ID:aljogabot,项目名称:AmazonStats,代码行数:15,代码来源:RedirectIfAuthenticated.php

示例14: resetAction

 public function resetAction()
 {
     $token = "?token=" . Input::get("token");
     $errors = new MessageBag();
     if ($old = Input::old("errors")) {
         $errors = $old;
     }
     $data = ["token" => $token, "errors" => $errors];
     if (Input::server("REQUEST_METHOD") == "POST") {
         $validator = Validator::make(Input::all(), ["email" => "required|email", "password" => "required|min:6", "password_confirmation" => "required|same:password", "token" => "required|exists:token,token"]);
         if ($validator->passes()) {
             $credentials = ["email" => Input::get("email")];
             Password::reset($credentials, function ($user, $password) {
                 $user->password = Hash::make($password);
                 $user->save();
                 Auth::login($user);
                 return Redirect::route("user/profile");
             });
         }
         $data["email"] = Input::get("email");
         $data["errors"] = $validator->errors();
         return Redirect::to(URL::route("user/reset") . $token)->withInput($data);
     }
     return View::make("user/reset", $data);
 }
开发者ID:alejandromorg,项目名称:Inventario,代码行数:25,代码来源:UserController.php

示例15: delete

 public function delete($id)
 {
     $check = Check::findOrFail($id);
     $check->delete();
     Session::flash('info', trans('check.delete.success', array('url' => $check->url, 'restoreUrl' => URL::route('check.restore', array('id' => $check->id)))));
     return Redirect::route('check.index');
 }
开发者ID:dbirchak,项目名称:ping,代码行数:7,代码来源:CheckController.php


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