本文整理汇总了PHP中Input::render方法的典型用法代码示例。如果您正苦于以下问题:PHP Input::render方法的具体用法?PHP Input::render怎么用?PHP Input::render使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Input
的用法示例。
在下文中一共展示了Input::render方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: render
public function render()
{
$checked = $this->getValue() == $this->get('value') ? 'checked' : null;
$this->set('checked', $checked);
$this->set('type', 'radio');
return parent::render();
}
示例2: render
/**
* @param string $name The element name
* @param string $value The this widget is checked if value is not null
* @param array $attributes An array of HTML attributes to be merged with the default HTML attributes
* @param array $errors An array of errors for the field
*
* @return string An HTML tag string
*
* @see
*/
public function render($name, $value = null, $attributes = array(), $errors = array())
{
if (null !== $value && $value !== false) {
$attributes['checked'] = 'checked';
}
if (!isset($attributes['value']) && null !== $this->getOption('value_attribute_value')) {
$attributes['value'] = $this->getOption('value_attribute_value');
}
return parent::render($name, null, $attributes, $errors);
}
示例3: render
public function render()
{
$this->setAttribute('type', 'checkbox');
if ($this->value) {
$this->setAttribute('checked', 'checked');
} else {
$this->setAttribute('checked');
}
return parent::render();
}
示例4: render
/**
* Render the HTML element in the provided context
*
* @param array $context
*
* @return string The HTML string output
*/
public function render($context = [])
{
$element = clone $this->element;
$value = $this->element->getAttribute('value', false);
if ($value !== false) {
$this->element->getAttributes()->remove('value');
}
$html = parent::render($context);
$this->element = $element;
return $html;
}
示例5: render
public function render()
{
$checked = null;
if (is_array($this->getValue()) && in_array($this->get('value'), $this->getValue())) {
$checked = 'checked';
} elseif ($this->get('value') == $this->getValue()) {
$checked = 'checked';
}
$this->set('checked', $checked);
$this->set('type', 'checkbox');
return parent::render();
}
示例6: render
public function render()
{
$this->setType('password');
return parent::render();
}
示例7: render
public function render()
{
$this->checkBinding();
return parent::render();
}
示例8: render
/**
* @return string
*/
public function render()
{
$this->attributes['value'] = null;
return parent::render();
}
示例9: render
public function render()
{
return parent::render() . $this->getLabel();
}
示例10: render
public function render($key, $extra = '')
{
return parent::render($key, $extra . ' class="simwp-color-field"');
}
示例11: render
public function render()
{
$this->set('type', 'hidden');
$this->set('value', $this->getValue());
return parent::render();
}
示例12: render
public function render()
{
$this->set('type', 'file');
return parent::render();
}
示例13: render
/**
* @param string $name The element name
* @param string $value The password stored in this widget, will be masked by the browser.
* @param array $attributes An array of HTML attributes to be merged with the default HTML attributes
* @param array $errors An array of errors for the field
*
* @return string An HTML tag string
*
* @see sfWidgetForm
*/
public function render($name, $value = null, $attributes = array(), $errors = array())
{
return parent::render($name, $this->getOption('always_render_empty') ? null : $value, $attributes, $errors);
}
示例14: render
public function render($name, $value = null, array $attrs = array())
{
return parent::render($name, null, $attrs);
}