本文整理汇总了PHP中FormElement::renderAttributes方法的典型用法代码示例。如果您正苦于以下问题:PHP FormElement::renderAttributes方法的具体用法?PHP FormElement::renderAttributes怎么用?PHP FormElement::renderAttributes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FormElement
的用法示例。
在下文中一共展示了FormElement::renderAttributes方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: renderAttributes
public function renderAttributes()
{
$this->_processAttributes();
if (!$this->path)
{
$action_path = $_SERVER['PHP_SELF'];
if($node_id = Limb :: toolkit()->getRequest()->get('node_id'))
$action_path .= '?node_id=' . $node_id;
}
else
$action_path = $this->path;
if (strpos($action_path, '?') === false)
$action_path .= '?';
else
$action_path .= '&';
if($this->action)
$action_path .= 'action=' . $this->action;
if ((bool)$this->reload_parent)
{
$action_path .= '&reload_parent=1';
}
$this->attributes['onclick'] = $this->onclick;
$this->attributes['onclick'] .= "submitForm(this.form, '{$action_path}')";
parent :: renderAttributes();
unset($this->attributes['onclick']);
}
示例2: renderAttributes
/**
* Overrides then calls with the parent render_attributes() method. Makes
* sure there is always a value attribute, even if it's empty.
* Called from within a compiled template render function.
*/
public function renderAttributes()
{
$value = $this->getValue();
if (!is_null($value))
{
$this->attributes['value'] = $value;
}
parent :: renderAttributes();
}
示例3: renderAttributes
/**
* Overrides then calls with the parent render_attributes() method dealing
* with the special case of the checked attribute
*/
public function renderAttributes()
{
$value = $this->getValue();
if ($value)
$this->attributes['checked'] = 1;
else
unset($this->attributes['checked']);
parent :: renderAttributes();
}
示例4: renderAttributes
/**
* Overrides then calls with the parent render_attributes() method dealing
* with the special case of the checked attribute
*/
public function renderAttributes()
{
$value = $this->getValue();
if (isset($this->attributes['value']) && $value == $this->attributes['value'])
{
$this->attributes['checked'] = 1;
}
else
{
unset($this->attributes['checked']);
}
parent::renderAttributes();
}
示例5: renderAttributes
public function renderAttributes()
{
if (!isset($this->attributes['path']) || !$this->attributes['path'])
{
$action_path = $_SERVER['PHP_SELF'];
$request = Limb :: toolkit()->getRequest();
if($node_id = $request->get('node_id'))
$action_path .= '?node_id=' . $node_id;
}
else
$action_path = $this->attributes['path'];
if (strpos($action_path, '?') === false)
$action_path .= '?';
else
$action_path .= '&';
if(isset($this->attributes['action']))
$action_path .= 'action=' . $this->attributes['action'];
if (isset($this->attributes['reload_parent']) && $this->attributes['reload_parent'])
{
$action_path .= '&reload_parent=1';
unset($this->attributes['reload_parent']);
}
if(!isset($this->attributes['onclick']))
$this->attributes['onclick'] = '';
$this->attributes['onclick'] .= "submitForm(this.form, '{$action_path}')";
unset($this->attributes['path']);
unset($this->attributes['action']);
parent :: renderAttributes();
}