当前位置: 首页>>代码示例>>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;未经允许,请勿转载。