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


PHP Iface::translate方法代码示例

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


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

示例1: setViewParams

 /**
  * Sets the necessary parameter values in the view.
  *
  * @param \Aimeos\MW\View\Iface $view The view object which generates the HTML output
  * @param array &$tags Result array for the list of tags that are associated to the output
  * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry)
  * @return \Aimeos\MW\View\Iface Modified view object
  */
 protected function setViewParams(\Aimeos\MW\View\Iface $view, array &$tags = array(), &$expire = null)
 {
     if (!isset($this->cache)) {
         $salutations = array(\Aimeos\MShop\Common\Item\Address\Base::SALUTATION_MR, \Aimeos\MShop\Common\Item\Address\Base::SALUTATION_MRS, \Aimeos\MShop\Common\Item\Address\Base::SALUTATION_MISS);
         try {
             $salutation = '';
             $addr = $view->extAddressItem;
             if (in_array($addr->getSalutation(), $salutations)) {
                 $salutation = $view->translate('client/code', $addr->getSalutation());
             }
             /// E-mail intro with salutation (%1$s), first name (%2$s) and last name (%3$s)
             $view->emailIntro = sprintf($view->translate('client', 'Dear %1$s %2$s %3$s'), $salutation, $addr->getFirstName(), $addr->getLastName());
         } catch (\Exception $e) {
             $view->emailIntro = $view->translate('client/html/email', 'Dear Sir or Madam');
         }
         $this->cache = $view;
     }
     return $this->cache;
 }
开发者ID:aimeos,项目名称:ai-client-html,代码行数:27,代码来源:Standard.php

示例2: setViewParams

 /**
  * Sets the necessary parameter values in the view.
  *
  * @param \Aimeos\MW\View\Iface $view The view object which generates the HTML output
  * @param array &$tags Result array for the list of tags that are associated to the output
  * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry)
  * @return \Aimeos\MW\View\Iface Modified view object
  */
 protected function setViewParams(\Aimeos\MW\View\Iface $view, array &$tags = array(), &$expire = null)
 {
     if (!isset($this->cache)) {
         if (($orderId = $view->param('his_id', null)) !== null) {
             $context = $this->getContext();
             $manager = \Aimeos\MShop\Factory::createManager($context, 'order');
             $baseManager = \Aimeos\MShop\Factory::createManager($context, 'order/base');
             $search = $manager->createSearch(true);
             $expr = array($search->getConditions(), $search->compare('==', 'order.id', $orderId), $search->compare('==', 'order.base.customerid', $context->getUserId()));
             $search->setConditions($search->combine('&&', $expr));
             $orderItems = $manager->searchItems($search);
             if (($orderItem = reset($orderItems)) === false) {
                 $msg = $view->translate('client', 'Order with ID "%1$s" not found');
                 throw new \Aimeos\Client\Html\Exception(sprintf($msg, $orderId));
             }
             if ($orderItem->getPaymentStatus() >= $this->getDownloadPaymentStatus()) {
                 $view->summaryShowDownloadAttributes = true;
             }
             $view->summaryBasket = $baseManager->load($orderItem->getBaseId());
             $view->summaryTaxRates = $this->getTaxRates($view->summaryBasket);
             $view->orderItem = $orderItem;
         }
         $this->cache = $view;
     }
     return $this->cache;
 }
开发者ID:aimeos,项目名称:ai-client-html,代码行数:34,代码来源:Standard.php


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