本文整理汇总了PHP中Widget::getAttributes方法的典型用法代码示例。如果您正苦于以下问题:PHP Widget::getAttributes方法的具体用法?PHP Widget::getAttributes怎么用?PHP Widget::getAttributes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Widget
的用法示例。
在下文中一共展示了Widget::getAttributes方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getAttributes
function getAttributes()
{
$attributes = parent::getAttributes();
if ($this->multiple) {
$attributes["name"] .= "[]";
}
return $attributes;
}
示例2: generate
/**
* Parse the template
*
* @return string
*/
public function generate()
{
$this->Template = new \FrontendTemplate($this->strTemplate);
$this->Template->field = $this->objWidget;
$this->Template->attributes = $this->objWidget->getAttributes();
$this->Template->tagEnding = $this->strTagEnding;
$this->Template->hideLabel = $this->hideLabel || $this->objWidget->hideLabel;
$this->Template->explanation = $this->explanation || $this->objWidget->explanation;
$this->Template->invisible = $this->invisible || $this->objWidget->invisible;
$this->Template->help = $this->parseHelp();
$this->setCssClasses();
$this->setGroupCssClasses();
$this->compile();
$this->Template->class = $this->getCssClasses();
$this->Template->groupClass = $this->getGroupCssClasses();
$this->Template->attributes = $this->objWidget->getAttributes();
$this->Template->placeholder = $this->parsePlaceholder();
return $this->Template->parse();
}
示例3: getAttributes
/**
* Return all attributes as string
*
* @param array $arrStrip An optional array with attributes to strip
*
* @return string The attributes string
*/
public function getAttributes($arrStrip = array())
{
// The "required" attribute only makes sense for single checkboxes
if (count($this->arrOptions) == 1 && $this->mandatory) {
$this->arrAttributes['required'] = 'required';
}
return parent::getAttributes($arrStrip);
}
示例4: getAttributes
/**
* Return all attributes as string
*
* @param array $arrStrip An optional array with attributes to strip
*
* @return string The attributes string
*/
public function getAttributes($arrStrip = array())
{
/** @var \PageModel $objPage */
global $objPage;
$arrStrip = array();
// XHTML does not support maxlength
if ($objPage->outputFormat == 'xhtml') {
$arrStrip[] = 'maxlength';
}
return parent::getAttributes($arrStrip);
}