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


PHP BaseControl::getControl方法代码示例

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


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

示例1: getControl

 public function getControl()
 {
     $container = Html::el();
     $container->add($this->wrappedControl->getControl());
     $container->add($this->applyButton->getControl($this->caption));
     return $container;
 }
开发者ID:mike227,项目名称:n-forms,代码行数:7,代码来源:ApplyButtonWrapper.php

示例2: getControl

 /**
  * Generates control's HTML element.
  *
  * @return string
  */
 public function getControl()
 {
     $items = $this->getItems();
     reset($items);
     $input = BaseControl::getControl();
     return Helpers::createInputList($this->translate ? $this->translate($items) : $items, array_merge($input->attrs, ['id' => NULL, 'checked?' => $this->value, 'disabled:' => $this->disabled, 'required' => NULL, 'data-nette-rules:' => [key($items) => $input->attrs['data-nette-rules']]]), $this->label->attrs, $this->separator);
 }
开发者ID:webchemistry,项目名称:forms-controls,代码行数:12,代码来源:CheckboxList.php

示例3: getControl

 /**
  * Generates control's HTML element.
  *
  * @return Html
  */
 public function getControl()
 {
     $parentControl = parent::getControl();
     $control = $this->getWrapperPrototype();
     $control->setId($parentControl->getId());
     $control->setHtml($this->getContent());
     return $control;
 }
开发者ID:f3l1x,项目名称:nette-plugins,代码行数:13,代码来源:MarkupControl.php

示例4: getControl

 /**
  * Just remove translations from each option
  * @return Nette\Forms\Helpers
  */
 public function getControl()
 {
     $items = $this->prompt === FALSE ? array() : array('' => $this->translate($this->prompt));
     foreach ($this->options as $key => $value) {
         $items[is_array($value) ? $key : $key] = $value;
     }
     return Nette\Forms\Helpers::createSelectBox($items, array('selected?' => $this->value, 'disabled:' => is_array($this->disabled) ? $this->disabled : NULL))->addAttributes(BaseControl::getControl()->attrs);
 }
开发者ID:ublaboo,项目名称:controls,代码行数:12,代码来源:NotTranslatableSelectBox.php

示例5: getControl

 /**
  * Generates control's HTML element.
  *
  * @return Html
  */
 public function getControl()
 {
     $parentControl = parent::getControl();
     $control = $this->getWrapperPrototype();
     $control->addAttributes(['id' => $parentControl->id]);
     $control->setHtml($this->getContent());
     return $control;
 }
开发者ID:minetro,项目名称:forms,代码行数:13,代码来源:Markup.php

示例6: getControl

 /**
  * Generates control's HTML element.
  *
  * @return Html
  */
 public function getControl()
 {
     $items = $this->getPrompt() === FALSE ? [] : ['' => $this->translate($this->getPrompt())];
     foreach ($this->options as $key => $value) {
         $items[$this->translate && is_array($value) ? $this->translate($key) : $key] = $this->translate ? $this->translate($value) : $value;
     }
     return Helpers::createSelectBox($items, ['selected?' => $this->value, 'disabled:' => is_array($this->disabled) ? $this->disabled : NULL])->addAttributes(BaseControl::getControl()->attrs);
 }
开发者ID:webchemistry,项目名称:forms-controls,代码行数:13,代码来源:SelectBox.php

示例7: getTextboxControl

 public function getTextboxControl($name)
 {
     $control = clone parent::getControl();
     $control->type = "text";
     $control->id = $name;
     $control->name .= "[{$name}]";
     $control->value = $this->value[$name];
     return $control;
 }
开发者ID:venca-x,项目名称:nettegmap,代码行数:9,代码来源:NetteGMapPicker.php

示例8: getControl

 /**
  * Generates control's HTML element.
  *
  * @return Html
  */
 public function getControl()
 {
     $container = clone $this->container;
     parent::getControl();
     $control = Html::el("div", array("style" => "text-align:justify"));
     $control->setHtml($this->translate((string) $this->getValue()));
     $container->add($control);
     return $container;
 }
开发者ID:pipaslot,项目名称:forms,代码行数:14,代码来源:TextOutput.php

示例9: getControl

 /**
  * Generates control's HTML element
  *
  * @return Html
  */
 public function getControl()
 {
     $control = parent::getControl();
     $control->addClass('checkbox3s');
     $val = $this->getValue();
     $control->data('lohini-state', $val ?: 0);
     if ($val == 1) {
         $control->checked = 'checked';
     }
     return Html::el('span')->add($control)->addClass('cb3s');
 }
开发者ID:lohini,项目名称:framework,代码行数:16,代码来源:Checkbox3S.php

示例10: getControl

 public function getControl()
 {
     $el = parent::getControl();
     if ($this->emptyValue !== '') {
         $el->attrs['data-nette-empty-value'] = Strings::trim($this->translate($this->emptyValue));
     }
     if (isset($el->placeholder)) {
         $el->placeholder = $this->translate($el->placeholder);
     }
     return $el;
 }
开发者ID:luminousinfoways,项目名称:pccfoas,代码行数:11,代码来源:TextBase.php

示例11: getControl

 /**
  * Generates control's HTML element.
  *
  * @return Html
  */
 public function getControl()
 {
     $input = BaseControl::getControl();
     $items = $this->getItems();
     $ids = [];
     if ($this->generateId) {
         foreach ($items as $value => $label) {
             $ids[$value] = $input->id . '-' . $value;
         }
     }
     return $this->container->setHtml(Helpers::createInputList($this->translate ? $this->translate($items) : $items, array_merge($input->attrs, ['id:' => $ids, 'checked?' => $this->value, 'disabled:' => $this->disabled, 'data-nette-rules:' => [key($items) => $input->attrs['data-nette-rules']]]), ['for:' => $ids] + $this->itemLabel->attrs, $this->separator));
 }
开发者ID:webchemistry,项目名称:forms-controls,代码行数:17,代码来源:RadioList.php

示例12: getControl

 /**
  * Generates control's HTML element.
  *
  * @author   Jan Tvrdík
  * @return   Nette\Web\Html
  */
 public function getControl()
 {
     $control = parent::getControl();
     $control->addClass($this->className);
     //		list($min, $max) = $this->extractRangeRule($this->getRules());
     //		if ($min !== NULL) $control->min = $min->format(self::W3C_DATE_FORMAT);
     //		if ($max !== NULL) $control->max = $max->format(self::W3C_DATE_FORMAT);
     if ($this->value) {
         $control->value = $this->value->format(self::W3C_DATE_FORMAT);
     }
     return $control;
 }
开发者ID:soundake,项目名称:pd,代码行数:18,代码来源:TimePicker.php

示例13: getControl

 public function getControl()
 {
     $control = parent::getControl();
     foreach ($this->getRules() as $rule) {
         if ($rule->type === Nette\Forms\Rule::VALIDATOR && !$rule->isNegative && ($rule->operation === Form::LENGTH || $rule->operation === Form::MAX_LENGTH)) {
             $control->maxlength = is_array($rule->arg) ? $rule->arg[1] : $rule->arg;
         }
     }
     if ($this->emptyValue !== '') {
         $control->data('nette-empty-value', $this->translate($this->emptyValue));
     }
     return $control;
 }
开发者ID:bazo,项目名称:Tatami,代码行数:13,代码来源:TextBase.php

示例14: getControl

 /**
  * Generates control's HTML element.
  */
 public function getControl()
 {
     parent::getControl();
     $days = array('' => 'Den') + array_combine(range(1, 31), range(1, 31));
     $yearsRange = range(date('Y'), date('Y') - 110);
     $years = array('' => 'Rok') + array_combine($yearsRange, $yearsRange);
     $monthsCzech = \JiriNapravnik\Common\DateCzech::getCzechMonthsNominativNumericKeys();
     $months = array('' => 'Měsíc');
     for ($i = 1; $i <= 12; $i++) {
         $months[$i] = $monthsCzech[$i];
     }
     $name = $this->getHtmlName();
     return Html::el()->add(Helpers::createSelectBox($days, array('selected?' => $this->day))->name($name . '[day]')->class('form-control day'))->add(Helpers::createSelectBox($months, array('selected?' => $this->month))->name($name . '[month]')->class('form-control month'))->add(Helpers::createSelectBox($years, array('selected?' => $this->year))->name($name . '[year]')->class('form-control year'));
 }
开发者ID:jirinapravnik,项目名称:common,代码行数:17,代码来源:DateInput.php

示例15: getControl

 public function getControl()
 {
     $this->setOption('rendered', TRUE);
     $value = $this->value;
     foreach ($this->filters as $filter) {
         $value = $filter($value);
     }
     $p = parent::getControl()->id($this->getHtmlId())->addClass('form-control-static');
     if ($value instanceof Html) {
         return $p->setHtml($value->addClass('control-label'));
     } else {
         return $p->setText(Html::el('span')->addClass('control-label')->setText((string) $value));
     }
 }
开发者ID:zaxcms,项目名称:framework,代码行数:14,代码来源:Static.php


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