當前位置: 首頁>>代碼示例>>PHP>>正文


PHP UrlGenerator::action方法代碼示例

本文整理匯總了PHP中Illuminate\Routing\UrlGenerator::action方法的典型用法代碼示例。如果您正苦於以下問題:PHP UrlGenerator::action方法的具體用法?PHP UrlGenerator::action怎麽用?PHP UrlGenerator::action使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Illuminate\Routing\UrlGenerator的用法示例。


在下文中一共展示了UrlGenerator::action方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: makeResponse

 protected function makeResponse(Request $request)
 {
     $message = $this->translator->get('c::auth.login-required');
     if ($request->ajax() || $request->isJson() || $request->wantsJson()) {
         return Response::json(['error' => $message], 403);
     } else {
         $url = $this->url->action('anlutro\\Core\\Web\\AuthController@login');
         $intended = $request->getMethod() == 'GET' ? $request->fullUrl() : ($request->header('referer') ?: '/');
         $this->session->put('url.intended', $intended);
         return $this->redirect->to($url)->with('error', $message);
     }
 }
開發者ID:anlutro,項目名稱:l4-core,代碼行數:12,代碼來源:AuthFilter.php

示例2: getIndex

 public function getIndex($status = '')
 {
     $threadCount = $this->request->get('take', $this->threadsPerPage);
     $tags = $this->tags->getAllTagsBySlug($this->request->get('tags'));
     $threads = $this->threads->getByTagsAndStatusPaginated($tags, $status, $threadCount);
     $collection = $threads->getCollection();
     $collection->each(function ($thread) {
         $thread->url = $this->url->action('ForumController@getViewThread', ['slug' => $thread->slug]);
     });
     // We want the newest threads to come out in chronological order
     return $collection->reverse();
 }
開發者ID:sdlyhu,項目名稱:laravelio,代碼行數:12,代碼來源:ForumThreadsController.php

示例3: getControllerAction

 /**
  * Get the action for an "action" option.
  *
  * @param  array|string  $options
  * @return string
  */
 protected function getControllerAction($options)
 {
     if (is_array($options)) {
         return $this->url->action($options[0], array_slice($options, 1));
     }
     return $this->url->action($options);
 }
開發者ID:GeorgeShazkho,項目名稱:micros-de-conce,代碼行數:13,代碼來源:FormBuilder.php

示例4: getAction

 /**
  * Get the controller action for a "action" option.
  *
  * @param  array|string  $action
  * @return string
  */
 protected function getAction($action)
 {
     if (is_array($action)) {
         return $this->url->action($action[0], array_slice($action, 1));
     }
     return $this->url->action($action);
 }
開發者ID:filipac,項目名稱:menus,代碼行數:13,代碼來源:Builder.php

示例5: dispatch

 /**
  * Get the action type from the options.
  *
  * @param  array  $options
  * @return string
  */
 public function dispatch($options)
 {
     if (isset($options['url'])) {
         return $this->getUrl($options);
     } elseif (isset($options['route'])) {
         return $this->url->route($options['route']);
     } elseif (isset($options['action'])) {
         return $this->url->action($options['action']);
     }
     return null;
 }
開發者ID:cloud5ideas,項目名稱:appkit,代碼行數:17,代碼來源:Builder.php

示例6: action

 /**
  * Get the URL to a controller action.
  *
  * @param string $action
  * @param mixed $parameters
  * @param bool $absolute
  * @return string 
  * @throws \InvalidArgumentException
  * @static 
  */
 public static function action($action, $parameters = array(), $absolute = true)
 {
     return \Illuminate\Routing\UrlGenerator::action($action, $parameters, $absolute);
 }
開發者ID:satriashp,項目名稱:tour,代碼行數:14,代碼來源:_ide_helper.php

示例7: linkAction

 /**
  * Generate a HTML link to a controller action.
  *
  * @param  string  $action
  * @param  string  $title
  * @param  array   $parameters
  * @param  array   $attributes
  * @return string
  */
 public function linkAction($action, $title = null, $parameters = array(), $attributes = array())
 {
     return $this->link($this->url->action($action, $parameters), $title, $attributes);
 }
開發者ID:manhvu1212,項目名稱:videoplatform,代碼行數:13,代碼來源:HtmlBuilder.php

示例8: action

 /**
  * Create a new redirect response to a controller action.
  *
  * @param  string  $action
  * @param  array   $parameters
  * @param  int     $status
  * @param  array   $headers
  * @return \Illuminate\Http\RedirectResponse
  */
 public function action($action, $parameters = [], $status = 302, $headers = [])
 {
     $path = $this->generator->action($action, $parameters);
     return $this->to($path, $status, $headers);
 }
開發者ID:illuminate,項目名稱:routing,代碼行數:14,代碼來源:Redirector.php

示例9: action

 /**
  * Get the URL to a controller action.
  *
  * @param  string  $action
  * @param  mixed   $parameters
  * @param  bool    $absolute
  * @return string
  */
 public function action($action, $parameters = array(), $absolute = true)
 {
     if ($path = $this->getPathFinder()->toControllerAction($action, $parameters)) {
         if (!$absolute) {
             return $path;
         }
         return $this->to($path);
     }
     return parent::action($action, $parameters, $absolute);
 }
開發者ID:realholgi,項目名稱:cmsable,代碼行數:18,代碼來源:SiteTreeUrlGenerator.php

示例10: action

 /**
  * Generate a HTML link to a controller action
  *
  * An array of parameters may be specified to fill in URI segment wildcards.
  *
  * @param  string $action
  * @param  string $title
  * @param  array  $parameters
  * @param  array  $attributes
  * @return string
  */
 public function action($action, $title = null, $parameters = array(), $attributes = array(), $absolute = true)
 {
     return $this->to($this->url->action($action, $parameters, $absolute), $title, $attributes);
 }
開發者ID:laravelbook,項目名稱:laravel4-powerpack,代碼行數:15,代碼來源:HTML.php


注:本文中的Illuminate\Routing\UrlGenerator::action方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。