当前位置: 首页>>代码示例>>PHP>>正文


PHP HiddenField::Field方法代码示例

本文整理汇总了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();
 }
开发者ID:SpiritLevel,项目名称:silverstripe-framework,代码行数:26,代码来源:TreeMultiselectField_Readonly.php

示例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);
 }
开发者ID:spekulatius,项目名称:silverstripe-bootstrap_extra_fields,代码行数:8,代码来源:KeepAliveField.php

示例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;
 }
开发者ID:helpfulrobot,项目名称:nimeso-silverstripe-drawpolygonfield,代码行数:18,代码来源:DrawPolygonField.php

示例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>';
    }
开发者ID:nicmart,项目名称:comperio-site,代码行数:20,代码来源:LiveDropdownField.php


注:本文中的HiddenField::Field方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。