當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。