本文整理汇总了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;
}
示例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);
}
示例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;
}
示例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);
}
示例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;
}
示例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);
}
示例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;
}
示例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;
}
示例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');
}
示例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;
}
示例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));
}
示例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;
}
示例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;
}
示例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'));
}
示例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));
}
}