本文整理匯總了PHP中QControl::RenderHtmlAttributes方法的典型用法代碼示例。如果您正苦於以下問題:PHP QControl::RenderHtmlAttributes方法的具體用法?PHP QControl::RenderHtmlAttributes怎麽用?PHP QControl::RenderHtmlAttributes使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類QControl
的用法示例。
在下文中一共展示了QControl::RenderHtmlAttributes方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: RenderHtmlAttributes
/**
* Render HTML attributes for the purpose of drawing the tag. Text objects have a number of parameters specific
* to them, some of which we use for validation, and some of which are dual purpose.
* We render those here, rather than setting the attributes when those are set.
*
* @param null $attributeOverrides
* @param null $styleOverrides
*
* @return string|void
*/
public function RenderHtmlAttributes($attributeOverrides = null, $styleOverrides = null)
{
if ($this->intMaxLength) {
$attributeOverrides['maxlength'] = $this->intMaxLength;
}
if ($this->strTextMode == QTextMode::MultiLine) {
if ($this->intColumns) {
$attributeOverrides['cols'] = $this->intColumns;
}
if ($this->intRows) {
$attributeOverrides['rows'] = $this->intRows;
}
//if (!$this->blnWrap) {
/**
* $strToReturn .= 'wrap="off" '; Note that this is not standard HTML5 and not supported by all browsers
* In fact, HTML5 has completely changed its meaning to mean whether the text itself has embedded
* hard returns inserted when the textarea wraps. Deprecating. We will have to wait for another solution.
*/
//}
} else {
if ($this->intColumns) {
$attributeOverrides['size'] = $this->intColumns;
}
$typeStr = $this->strTextMode ? $this->strTextMode : 'text';
$attributeOverrides['type'] = $typeStr;
}
if (strlen($this->strPlaceholder) > 0) {
$attributeOverrides['placeholder'] = $this->strPlaceholder;
}
return parent::RenderHtmlAttributes($attributeOverrides, $styleOverrides);
}