本文整理汇总了PHP中TextField::addAttributeObject方法的典型用法代码示例。如果您正苦于以下问题:PHP TextField::addAttributeObject方法的具体用法?PHP TextField::addAttributeObject怎么用?PHP TextField::addAttributeObject使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TextField
的用法示例。
在下文中一共展示了TextField::addAttributeObject方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: render
public function render()
{
global $redirectedPackage;
global $packageSchema;
$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, 'and_bound_data' => $this->andBoundData, 'redirected_package' => $redirectedPackage, 'package_schema' => $packageSchema);
$jsonSearchFields = array_reverse($this->searchFields);
$object = base64_encode(serialize($object));
$path = Application::$prefix . "/system/api/query?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");
foreach ($this->attributes as $attribute) {
$text->addAttributeObject($attribute);
}
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;
}