本文整理汇总了PHP中FormElement::__toString方法的典型用法代码示例。如果您正苦于以下问题:PHP FormElement::__toString方法的具体用法?PHP FormElement::__toString怎么用?PHP FormElement::__toString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FormElement
的用法示例。
在下文中一共展示了FormElement::__toString方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
function __toString()
{
//Allows children to write this attribute first
if ($this->getAttribute('value') === false) {
$this->setAttribute("value", $this->getRawValue());
}
return parent::__toString();
}
示例2:
function __toString()
{
$this->setAttribute('class', 'tinymce_textarea');
$this->innerHTML = HtmlHelper::escape($this->_value);
$config = JsonHelper::encode($this->config);
$script = HtmlHelper::inlineJavascript('tinyMCE.init(' . $config . ');');
$this->afterHTML = $script;
self::$instances_included++;
return parent::__toString();
}
示例3:
function __toString()
{
if (!$this->getAttribute('cols')) {
$this->setAttribute('cols', 30);
}
if (!$this->getAttribute('rows')) {
$this->setAttribute('rows', 5);
}
$this->innerHTML = HtmlHelper::escape($this->_value);
return parent::__toString();
}
示例4: foreach
function __toString()
{
$options = $this->createHtmlOptions($this->_options);
if (is_array($this->_data_source)) {
$data = $this->_data_source;
} else {
$data = $this->_data_source->fetchKeyValue();
}
$options = array_merge($options, $this->createHtmlOptions($data));
$group_html = "";
foreach ($this->_opt_groups as $group => $items) {
$groups_items = $this->createHtmlOptions($items);
$group_html .= "<optgroup label=\"{$group}\">" . join("\r\n", $groups_items) . "</optgroup>";
}
$this->innerHTML = join("\r\n", $options) . $group_html;
return parent::__toString();
}