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


PHP IControl::translate方法代码示例

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


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

示例1: renderControl

 /**
  * Renders 'control' part of visual row of controls.
  * @return string
  */
 public function renderControl(Nette\Forms\IControl $control)
 {
     $body = $this->getWrapper('control container');
     if ($this->counter % 2) {
         $body->class($this->getValue('control .odd'), TRUE);
     }
     $description = $control->getOption('description');
     if ($description instanceof Html) {
         $description = ' ' . $description;
     } elseif (is_string($description)) {
         $description = ' ' . $this->getWrapper('control description')->setText($control->translate($description));
     } else {
         $description = '';
     }
     if ($control->isRequired()) {
         $description = $this->getValue('control requiredsuffix') . $description;
     }
     $control->setOption('rendered', TRUE);
     $el = $control->getControl();
     if ($el instanceof Html && $el->getName() === 'input') {
         $el->class($this->getValue("control .{$el->type}"), TRUE);
     }
     return $body->setHtml($el . $description . $this->renderErrors($control));
 }
开发者ID:luminousinfoways,项目名称:pccfoas,代码行数:28,代码来源:DefaultFormRenderer.php

示例2: renderControl

 /**
  * Renders 'control' part of visual row of controls.
  * @return string
  */
 public function renderControl(Nette\Forms\IControl $control)
 {
     $body = $this->getWrapper('control container');
     if ($this->counter % 2) {
         $body->class($this->getValue('control .odd'), TRUE);
     }
     $description = $control->getOption('description');
     if ($description instanceof Html) {
         $description = ' ' . $control->getOption('description');
     } elseif (is_string($description)) {
         $description = ' ' . $this->getWrapper('control description')->setText($control->translate($description));
     } else {
         $description = '';
     }
     if ($control->isRequired()) {
         $description = $this->getValue('control requiredsuffix') . $description;
     }
     if ($this->getValue('control errors')) {
         $description .= $this->renderErrors($control);
     }
     if ($control instanceof Nette\Forms\Controls\Checkbox || $control instanceof Nette\Forms\Controls\Button) {
         return $body->setHtml((string) $control->getControl() . (string) $control->getLabel() . $description);
     } else {
         return $body->setHtml((string) $control->getControl() . $description);
     }
 }
开发者ID:svobodni,项目名称:web,代码行数:30,代码来源:DefaultFormRenderer.php

示例3: renderControl

 /**
  * Renders 'control' part of visual row of controls.
  * @return string
  */
 public function renderControl(Nette\Forms\IControl $control)
 {
     $body = $this->getWrapper('control container');
     if ($this->counter % 2) {
         $body->class($this->getValue('control .odd'), TRUE);
     }
     $description = $control->getOption('description');
     if ($description instanceof Html) {
         $description = ' ' . $description;
     } elseif (is_string($description)) {
         $description = ' ' . $this->getWrapper('control description')->setText($control->translate($description));
     } else {
         $description = '';
     }
     if ($control->isRequired()) {
         $description = $this->getValue('control requiredsuffix') . $description;
     }
     $el = $control->getControl();
     if ($control instanceof Nette\Forms\Controls\TextInput || $control instanceof Nette\Forms\Controls\TextArea || $control instanceof Nette\Forms\Controls\SelectBox || $control instanceof Nette\Forms\Controls\MultiSelectBox) {
         $el->class($this->getValue("control form-control"), TRUE);
     }
     if ($control instanceof Nette\Forms\Controls\Checkbox) {
         //$el = $control->getLabel()->insert(0, $el);//reapair in NF 2.1RC3
         $elTemp = $el;
         $el = Html::el('div', array("class" => $this->getValue("pair containerCheckbox")));
         $el->setHtml($elTemp);
     }
     if ($this->isFormHorizontal() && $control instanceof Nette\Forms\Controls\Checkbox) {
         $div = Html::el('div', array("class" => $this->getValue("control col-offset")));
     } else {
         if ($this->isFormHorizontal()) {
             $div = Html::el('div', array("class" => $this->getValue("control col")));
         } else {
             $div = Html::el();
         }
     }
     $div->setHtml($el . $description . $this->renderErrors($control));
     return $body->addHtml($div);
 }
开发者ID:venca-x,项目名称:tb3formrenderer,代码行数:43,代码来源:TB3FormRenderer.php


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