本文整理汇总了PHP中HiddenField::Field方法的典型用法代码示例。如果您正苦于以下问题:PHP HiddenField::Field方法的具体用法?PHP HiddenField::Field怎么用?PHP HiddenField::Field使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HiddenField
的用法示例。
在下文中一共展示了HiddenField::Field方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Field
public function Field($properties = array())
{
$titleArray = $itemIDs = array();
$titleList = $itemIDsList = "";
if ($items = $this->getItems()) {
foreach ($items as $item) {
$titleArray[] = $item->Title;
}
foreach ($items as $item) {
$itemIDs[] = $item->ID;
}
if ($titleArray) {
$titleList = implode(", ", $titleArray);
}
if ($itemIDs) {
$itemIDsList = implode(",", $itemIDs);
}
}
$field = new ReadonlyField($this->name . '_ReadonlyValue', $this->title);
$field->setValue($titleList);
$field->setForm($this->form);
$valueField = new HiddenField($this->name);
$valueField->setValue($itemIDsList);
$valueField->setForm($this->form);
return $field->Field() . $valueField->Field();
}
示例2: Field
public function Field($properties = array())
{
Requirements::javascript(THIRDPARTY_DIR . '/jquery/jquery.js');
Requirements::javascript('bootstrap_extra_fields/javascript/KeepAliveField.js');
$this->addExtraClass('keep-alive-field');
$this->setAttribute('data-link', $this->Link('load'));
return parent::Field($properties);
}
示例3: Field
public function Field($properties = array())
{
//Requirements::javascript(FRAMEWORK_DIR . '/thirdparty/jquery/jquery.js');
$jsvars = array("Name" => $this->name);
Requirements::javascript("drawpolygonfield/javascript/drawpolygonfield.js", $jsvars);
Requirements::css("drawpolygonfield/css/drawpolygonfield.css");
$content = parent::Field();
$imgStr = "";
if (count($this->baseImages) > 0) {
$numUp = 0;
foreach ($this->baseImages as $baseImage) {
$imgStr .= "<img class='level_" . $numUp . "' src='" . $baseImage->URL . "'/>";
$numUp++;
}
}
$content .= "<hr><h4>Preview</h4><p>Click in the region below to start defining a area</p><div class='stacked-images'>" . $imgStr . "<canvas id='" . $this->name . "PolyCanvas' width=" . $this->width . " height=" . $this->height . "></canvas></div><div class='PolyActions'><button id='clearpoly' class='btn'>Clear Canvas</button></div><hr>";
return $content;
}
示例4: Field
public function Field()
{
$text = "";
if ($this->Value()) {
if ($record = DataObject::get_by_id($this->sourceClass, (int) $this->Value())) {
$text = $record->{$this->labelField};
}
}
Requirements::javascript(THIRDPARTY_DIR . '/jquery/jquery.js');
Requirements::javascript(THIRDPARTY_DIR . '/jquery-metadata/jquery.metadata.js');
Requirements::javascript(THIRDPARTY_DIR . '/jquery-livequery/jquery.livequery.js');
Requirements::javascript('dataobject_manager/code/autocomplete_field/javascript/autocomplete_field.js');
Requirements::css('dataobject_manager/code/autocomplete_field/css/autocomplete_field.css');
return '<div class="field text autocomplete_holder livedropdownfield">
<label for="' . $this->id() . '">' . $this->Title() . '</label>
<div class="middleColumn">
<input type="text" class="field text autocomplete_input {\'url\' : \'' . $this->Link('getresults') . '\'}" name="' . $this->Name() . '_search" value="' . $text . '" />' . parent::Field() . '<button class="livedropdown_browse">' . _t('LiveDropdownField.BROWSE', 'Browse...') . '</button>' . '<div class="autocomplete_results"></div>
</div>
</div>';
}