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


PHP Iface::addHelper方法代码示例

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


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

示例1: addUrl

 /**
  * Adds the "url" helper to the view object
  *
  * @param \Aimeos\MW\View\Iface $view View object
  * @param \TYPO3\Flow\Mvc\Routing\UriBuilder $uriBuilder URL builder object
  * @param \TYPO3\Flow\Mvc\RequestInterface|null $request Request object
  * @return \Aimeos\MW\View\Iface Modified view object
  */
 protected function addUrl(\Aimeos\MW\View\Iface $view, \TYPO3\Flow\Mvc\Routing\UriBuilder $uriBuilder, \TYPO3\Flow\Mvc\RequestInterface $request = null)
 {
     $fixed = array();
     if ($request !== null) {
         $params = $request->getArguments();
         if (isset($params['site'])) {
             $fixed['site'] = $params['site'];
         }
         if (isset($params['locale'])) {
             $fixed['locale'] = $params['locale'];
         }
         if (isset($params['currency'])) {
             $fixed['currency'] = $params['currency'];
         }
     }
     $helper = new \Aimeos\MW\View\Helper\Url\Flow($view, $uriBuilder, $fixed);
     $view->addHelper('url', $helper);
     return $view;
 }
开发者ID:aimeos,项目名称:aimeos-flow,代码行数:27,代码来源:View.php

示例2: addUrl

 /**
  * Adds the "url" helper to the view object
  *
  * @param \Aimeos\MW\View\Iface $view View object
  * @return \Aimeos\MW\View\Iface Modified view object
  */
 protected function addUrl(\Aimeos\MW\View\Iface $view)
 {
     $fixed = array();
     if (Route::current()) {
         if (($value = Route::input('site')) !== null) {
             $fixed['site'] = $value;
         }
         if (($value = Route::input('locale')) !== null) {
             $fixed['locale'] = $value;
         }
         if (($value = Route::input('currency')) !== null) {
             $fixed['currency'] = $value;
         }
     }
     $helper = new \Aimeos\MW\View\Helper\Url\Laravel5($view, app('url'), $fixed);
     $view->addHelper('url', $helper);
     return $view;
 }
开发者ID:aimeos,项目名称:aimeos-laravel,代码行数:24,代码来源:View.php

示例3: addUrl

 /**
  * Adds the "url" helper to the view object
  *
  * @param \Aimeos\MW\View\Iface $view View object
  * @return \Aimeos\MW\View\Iface Modified view object
  */
 protected function addUrl(\Aimeos\MW\View\Iface $view)
 {
     $fixed = array();
     $request = $this->requestStack->getMasterRequest();
     if ($request !== null) {
         $attr = $request->attributes;
         if (($site = $attr->get('site')) !== null) {
             $fixed['site'] = $site;
         }
         if (($lang = $attr->get('locale')) !== null) {
             $fixed['locale'] = $lang;
         }
         if (($currency = $attr->get('currency')) !== null) {
             $fixed['currency'] = $currency;
         }
     }
     $helper = new \Aimeos\MW\View\Helper\Url\Symfony2($view, $this->container->get('router'), $fixed);
     $view->addHelper('url', $helper);
     return $view;
 }
开发者ID:aimeos,项目名称:aimeos-symfony2,代码行数:26,代码来源:View.php

示例4: addUrl

 /**
  * Adds the "url" helper to the view object
  *
  * @param \Aimeos\MW\View\Iface $view View object
  * @param array $attributes Associative list of URI parameters
  * @return \Aimeos\MW\View\Iface Modified view object
  */
 protected function addUrl(\Aimeos\MW\View\Iface $view, array $attributes)
 {
     $fixed = array();
     if (isset($attributes['site'])) {
         $fixed['site'] = $attributes['site'];
     }
     if (isset($attributes['locale'])) {
         $fixed['locale'] = $attributes['locale'];
     }
     if (isset($attributes['currency'])) {
         $fixed['currency'] = $attributes['currency'];
     }
     $helper = new \Aimeos\MW\View\Helper\Url\Slim($view, $this->container->get('router'), $fixed);
     $view->addHelper('url', $helper);
     return $view;
 }
开发者ID:aimeos,项目名称:aimeos-slim,代码行数:23,代码来源:View.php


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