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


PHP Url::route方法代码示例

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


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

示例1: processView

 public static function processView($params, &$view)
 {
     if (!isset($params['get'])) {
         return '';
     }
     $params['get'] = Route::route($params['get'], $params);
     if (!Request::isAvailable($params['get'], 'get')) {
         return;
     }
     $vars_backup = $view->_tpl_vars;
     if (is_array($params)) {
         foreach ($params as $name => $value) {
             $view->assign($name, $value);
         }
     }
     list($controller, $action, $data) = Url::route($params['get'], 'get');
     $handler = Url::handler($controller, $action);
     if (empty($handler)) {
         return '';
     }
     if (!empty($params['display'])) {
         $handler .= '.' . $params['display'];
     }
     $result = $view->fetch('Modules/' . $handler . '.tpl');
     $view->_tpl_vars = $vars_backup;
     if (!empty($params['wrapper']) && !empty($result)) {
         return '<div class="' . $params['wrapper'] . '">' . $result . '</div>';
     }
     return $result;
 }
开发者ID:evgeny-v-z,项目名称:framework,代码行数:30,代码来源:Templater.php

示例2: processView

 public static function processView($params, &$view)
 {
     if (!isset($params['get'])) {
         return '';
     }
     $params['get'] = Route::resource($params['get'], $params);
     if (!Request::isAvailable($params['get'], 'get')) {
         return;
     }
     $vars_backup = $view->_tpl_vars;
     if (is_array($params)) {
         foreach ($params as $name => $value) {
             $view->assign($name, $value);
         }
     }
     list($controller, $action, $data) = Url::route($params['get'], 'get');
     $params = array_merge($params, $data);
     $handler = Url::handler($controller, $action);
     if (empty($handler)) {
         return '';
     }
     if (!empty($params['display'])) {
         $handler .= '.' . $params['display'];
     }
     $view->assign('params', $params);
     $result = $view->fetch('file:' . $handler . '.tpl');
     $view->_tpl_vars = $vars_backup;
     if (!empty($params['wrapper']) && !empty($result)) {
         list($start, $end) = static::wrapper($params['wrapper']);
         return $start . $result . $end;
     }
     return $result;
 }
开发者ID:pinahq,项目名称:framework,代码行数:33,代码来源:Templater.php

示例3: create

 /**
  * Builds a menu for displaying associated items to a model entry (i.e. /club/21/team).
  *
  * The menu will include:
  *  - An Add LinkMenuItem;
  *  - A SpacerMenuItem with the name of the associated model;
  *  - A ResourceMenuItem to hold entries of the associated model.
  *
  * @param String      $modelName       The name of the model (i.e. Club).
  * @param int         $modelId         The id of the model entry.
  * @param String      $associationName The name of the associated model (i.e. Team).
  * @param ModelConfig $config          (optional) The `ModelConfig` to use.
  *
  * @return Menu the Menu, which can be configured further.
  */
 public function create($modelName, $modelId, $associationName, ModelConfig $config = null)
 {
     $menu = new Menu();
     $addMenuItem = new LinkMenuItem();
     $addMenuItem->setText(Lang::trans('Add') . ' ' . Lang::trans($associationName));
     $addMenuItem->setIcon(Icons::ion_plus);
     $addMenuItem->setTarget(Url::route($this->aujaRouter->getCreateAssociationName($modelName, $associationName), $modelId));
     $menu->addMenuItem($addMenuItem);
     $headerMenuItem = new SpacerMenuItem();
     $headerMenuItem->setText(Lang::trans(str_plural($associationName)));
     $menu->addMenuItem($headerMenuItem);
     $resourceMenuItem = new ResourceMenuItem();
     $resourceMenuItem->setTarget(Url::route($this->aujaRouter->getAssociationName($modelName, $associationName), $modelId));
     $menu->addMenuItem($resourceMenuItem);
     return $menu;
 }
开发者ID:hramose,项目名称:Auja-Laravel,代码行数:31,代码来源:AssociationMenuFactory.php

示例4: run

 public static function run($resource, $method)
 {
     $top = count(self::$stack) - 1;
     if ($top < 0) {
         return;
     }
     $isExternal = $top == 0;
     $resource = Route::route($resource, self::$stack[$top]);
     if (!self::isAvailable($resource, $method)) {
         if ($isExternal) {
             $resource = 'errors/access-denied';
         } else {
             return '';
         }
     }
     list($controller, $action, $data) = Url::route($resource, $method);
     self::$stack[$top] = array_merge(self::$stack[$top], $data);
     $handler = Url::handler($controller, $action);
     if ($isExternal) {
         Middleware::processBefore($resource, $action, self::$stack[$top], $method);
         self::runHandler($handler);
         Middleware::processAfter($resource, $action, self::$stack[$top], $method);
     } else {
         if (!self::runInternalHandler($handler)) {
             return '';
         }
     }
     if (!empty(self::$stack[$top]['display'])) {
         $handler .= '.' . self::$stack[$top]['display'];
     }
     if ($isExternal && self::$response->code == '404 Not Found') {
         list($controller, $action, $data) = Url::route('errors/not-found', 'get');
         $handler = Url::handler($controller, $action);
         self::$response->result("error", self::$response->code);
     }
     if ($isExternal && self::$response->code == '403 Forbidden') {
         list($controller, $action, $data) = Url::route('errors/not-found', 'get');
         $handler = Url::handler($controller, $action);
         self::$response->result("error", self::$response->code);
     }
     $r = self::$response->fetch($handler, $isExternal);
     if ($isExternal) {
         Language::rewrite($r);
     }
     return $r;
 }
开发者ID:evgeny-v-z,项目名称:framework,代码行数:46,代码来源:Request.php

示例5: getListingUrl

function getListingUrl($params = [])
{
    $params = $params + ['from' => \Input::get('from'), 'to' => \Input::get('to')];
    return \Url::route('posts.listing', $params);
}
开发者ID:ArturKp,项目名称:bloglyzer,代码行数:5,代码来源:columns.blade.php

示例6: smartIncludeMenuItems

 private function smartIncludeMenuItems($main, $config)
 {
     foreach ($this->aujaConfigurator->getModels() as $model) {
         if ($this->aujaConfigurator->shouldSmartIncludeInMain($model, $config)) {
             $item = new Item();
             $item->setTitle($model->getName());
             $item->setIcon($this->aujaConfigurator->getIcon($model, $config));
             $item->setTarget(Url::route($this->aujaRouter->getMenuName($model->getName())));
             $main->addItem($item);
         }
     }
 }
开发者ID:hramose,项目名称:Auja-Laravel,代码行数:12,代码来源:MainFactory.php

示例7: doDetectAuth

 /**
  * Init url payment authorization
  */
 private function doDetectAuth()
 {
     if ($this->payment->cvc == '333') {
         $this->auth = Url::route('ff-bank-em-pay-auth', array('payment' => Crypt::encrypt($this->payment->id), 'back' => urlencode(Url::route('ff-bank-em-endpoint-auth-result'))));
         $this->payment->status = Status::AUTHORIZATION;
     }
 }
开发者ID:fintech-fab,项目名称:bank-emulator,代码行数:10,代码来源:Payment.php


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