本文整理汇总了PHP中HiddenField::addAttribute方法的典型用法代码示例。如果您正苦于以下问题:PHP HiddenField::addAttribute方法的具体用法?PHP HiddenField::addAttribute怎么用?PHP HiddenField::addAttribute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HiddenField
的用法示例。
在下文中一共展示了HiddenField::addAttribute方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: render
public function render()
{
$name = $this->getName();
$hidden = new HiddenField($name, $this->getValue());
$id = $this->getId();
$hidden->addAttribute("id", $id);
$ret = $hidden->render();
if ($this->storedFieldSet === false) {
$this->addSearchField($this->storedField);
$this->storedFieldSet = true;
}
$object = array("model" => $this->model->package, "format" => "json", "fields" => $this->searchFields, "limit" => 20, "conditions" => "", "and_conditions" => $this->andConditions);
$jsonSearchFields = array_reverse($this->searchFields);
$object = base64_encode(serialize($object));
$path = Application::$prefix . "/lib/models/urlaccess.php?object={$object}";
$fields = urlencode(json_encode($jsonSearchFields));
$text = new TextField();
$text->addAttribute("onkeyup", "fapiUpdateSearchField('{$id}','{$path}','{$fields}',this," . ($this->boldFirst ? "true" : "false") . ",'{$this->onChangeAttribute}')");
$text->addAttribute("autocomplete", "off");
if ($this->getValue() != "") {
$data = $this->model[$this->getValue()];
for ($i = 2; $i < count($jsonSearchFields); $i++) {
$val .= $data[0][$jsonSearchFields[$i]] . " ";
}
$text->setValue($val);
}
$text->setId($id . "_search_entry");
$ret .= $text->render();
$ret .= "<div class='fapi-popup' id='{$id}_search_area'></div>";
return $ret;
}
示例2: TextField
function __construct()
{
parent::__construct('clone-form');
$this->ajax = true;
$this->setAction(OW::getRouter()->urlFor('ADMIN_CTRL_Languages', 'ajaxClone'));
$this->setMethod('post');
$labelTextField = new TextField('label');
$labelTextField->setLabel(OW::getLanguage()->text('admin', 'clone_form_lbl_label'))->setDescription(OW::getLanguage()->text('admin', 'clone_form_descr_label'));
$this->addElement($labelTextField);
$tagTextField = new TextField('tag');
$tagTextField->addValidator(new LanguageTagValidator());
$tagTextField->setLabel(OW::getLanguage()->text('admin', 'clone_form_lbl_tag'))->setDescription(OW::getLanguage()->text('admin', 'clone_form_descr_tag'));
$this->addElement($tagTextField);
$hiddenField = new HiddenField('language');
$hiddenField->addAttribute('class', 'hidden_lang_tag');
$submit = new Submit('submit');
$submit->setValue(OW::getLanguage()->text('admin', 'clone_form_lbl_submit'));
$this->addElement($submit);
$this->addElement($hiddenField);
//value to be set by javascript
if (!OW::getRequest()->isAjax()) {
OW::getDocument()->addOnloadScript("owForms['{$this->getName()}'].bind('success', function(){location.reload();});");
}
}