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


PHP FormField::getAttributes方法代码示例

本文整理汇总了PHP中FormField::getAttributes方法的典型用法代码示例。如果您正苦于以下问题:PHP FormField::getAttributes方法的具体用法?PHP FormField::getAttributes怎么用?PHP FormField::getAttributes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在FormField的用法示例。


在下文中一共展示了FormField::getAttributes方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testAttributes

	function testAttributes() {
		$field = new FormField('MyField');
		$field->setAttribute('foo', 'bar');
		$this->assertEquals('bar', $field->getAttribute('foo'));
		$attrs = $field->getAttributes();
		$this->assertArrayHasKey('foo', $attrs);
		$this->assertEquals('bar', $attrs['foo']);
	}
开发者ID:redema,项目名称:sapphire,代码行数:8,代码来源:FormFieldTest.php

示例2: getAttributes

 /**
  * @return array
  */
 public function getAttributes()
 {
     $maxLength = $this->getMaxLength();
     $attributes = array();
     if ($maxLength) {
         $attributes['maxLength'] = $maxLength;
         $attributes['size'] = min($maxLength, 30);
     }
     return array_merge(parent::getAttributes(), $attributes);
 }
开发者ID:ivoba,项目名称:silverstripe-framework,代码行数:13,代码来源:TextField.php

示例3: getAttributes

	function getAttributes() {
		return array_merge(
			parent::getAttributes(),
			array(
				'rows' => $this->rows,
				'cols' => $this->cols,
				'value' => null,
				'type' => null
			)
		);
	}
开发者ID:redema,项目名称:sapphire,代码行数:11,代码来源:TextareaField.php

示例4: getAttributes

	function getAttributes() {
		return array_merge(
			parent::getAttributes(),
			array(
				'disabled' => ($this->isReadonly() || $this->isDisabled()),
				'value' => $this->Title(),
				'type' => ($this->useButtonTag) ? null : 'submit',
				'title' => ($this->useButtonTag) ? $this->description : null,
			)
		);
	}
开发者ID:redema,项目名称:sapphire,代码行数:11,代码来源:FormAction.php

示例5: getAttributes

 function getAttributes()
 {
     $attributes = parent::getAttributes();
     if (isset($attributes['name'])) {
         $attributes['data-name'] = $attributes['name'];
     }
     array_walk($this->settings, function ($value, $name) use(&$attributes) {
         $attributes['data-' . $name] = trim(json_encode($value, JSON_UNESCAPED_SLASHES), '"\'');
     });
     return array_filter($attributes, function ($name) {
         return !in_array($name, $this->inputOnlyAttributes);
     }, ARRAY_FILTER_USE_KEY);
 }
开发者ID:helpfulrobot,项目名称:milkyway-multimedia-ss-mwm-formfields,代码行数:13,代码来源:RangeSliderField.php

示例6: getAttributes

 public function getAttributes()
 {
     return array_merge(parent::getAttributes(), array('tabindex' => null, 'type' => null, 'value' => null, 'type' => null, 'title' => $this->tag == 'fieldset' ? null : $this->legend));
 }
开发者ID:miamollie,项目名称:echoAerial,代码行数:4,代码来源:CompositeField.php

示例7: getAttributes

 public function getAttributes()
 {
     return array_merge(parent::getAttributes(), array('type' => null, 'value' => null));
 }
开发者ID:jacobbuck,项目名称:silverstripe-framework,代码行数:4,代码来源:SelectField.php

示例8: getAttributes

 /**
  * Returns the field's HTML attributes
  * @return array HTML attributes
  */
 public function getAttributes()
 {
     return array_merge(parent::getAttributes(), array('size' => $this->maxLength, 'class' => 'text colorField'));
 }
开发者ID:helpfulrobot,项目名称:colymba-silverstripe-colorfield,代码行数:8,代码来源:ColorField.php

示例9: getAttributes

 /**
  * {@inheritdoc}
  */
 public function getAttributes()
 {
     return array_merge(parent::getAttributes(), array('type' => 'hidden'));
 }
开发者ID:jakedaleweb,项目名称:AtomCodeChallenge,代码行数:7,代码来源:HiddenField.php

示例10: getAttributes

 public function getAttributes()
 {
     $attributes = parent::getAttributes();
     $attributes['name'] = $this->getName() . '[url]';
     return $attributes;
 }
开发者ID:silverstripers,项目名称:cloudinary,代码行数:6,代码来源:CloudinaryUpload.php

示例11: testUpdateAttributes

 public function testUpdateAttributes()
 {
     $field = new FormField('MyField');
     $this->assertArrayHasKey('extended', $field->getAttributes());
 }
开发者ID:XDdesigners,项目名称:silverstripe-framework,代码行数:5,代码来源:FormFieldTest.php

示例12: getAttributes

 function getAttributes()
 {
     return array_merge(parent::getAttributes(), array('maxlength' => $this->getMaxLength(), 'size' => $this->getMaxLength() ? min($this->getMaxLength(), 30) : null));
 }
开发者ID:prostart,项目名称:cobblestonepath,代码行数:4,代码来源:TextField.php

示例13: getAttributes

 public function getAttributes()
 {
     $attributes = parent::getAttributes();
     unset($attributes['value']);
     return $attributes;
 }
开发者ID:somardesignstudios,项目名称:silverstripe-mapdrawingfield,代码行数:6,代码来源:MapDrawingField.php

示例14: FieldHolder

 /**
  * @param array $properties
  * @return string
  */
 public function FieldHolder($properties = array())
 {
     $content = array('actions' => '', 'content' => '', 'gridfield' => '');
     /** -----------------------------------------
      * Actions
      * ----------------------------------------*/
     $newContainer = FormField::create_tag('a', array('id' => $this->ID, 'class' => 'ss-ui-action-constructive ss-ui-button js-action site-builder__actions__item site-builder__action site-builder__actions__item--new-container', 'href' => $this->Link() . '/siteBuilderAddContainer?ParentID=' . $this->PageID), _t('SiteBuilder.ADDCONTAINER', 'Add Container') . ' <i class="icon ' . $this->config()->loading_icon . '"></i>');
     $content['actions'] = FormField::create_tag('ul', array('class' => 'site-builder__actions'), $newContainer);
     /** -----------------------------------------
      * Content
      * ----------------------------------------*/
     $items = $this->getList();
     $containers = array();
     foreach ($items as $key => $item) {
         /** @var PageBuilderContainer $item */
         $containers[] = $this->newContainer($item->ID, $item->Items());
     }
     $content['content'] = FormField::create_tag('div', array('data-url' => $this->Link(), 'class' => 'site-builder'), implode("\n", $containers));
     /** -----------------------------------------
      * Attributes
      * ----------------------------------------*/
     $attributes = array_merge(parent::getAttributes(), array('data-url' => $this->Link()));
     /** -----------------------------------------
      * Return
      * ----------------------------------------*/
     return FormField::create_tag('fieldset', array(), FormField::create_tag('div', $attributes, implode('', $content)));
 }
开发者ID:helpfulrobot,项目名称:toastnz-silverstripe-site-builder,代码行数:31,代码来源:SiteBuilder.php

示例15: getAttributes

 public function getAttributes()
 {
     $type = isset($this->attributes['src']) ? 'image' : 'submit';
     return array_merge(parent::getAttributes(), array('disabled' => $this->isReadonly() || $this->isDisabled(), 'value' => $this->Title(), 'type' => $type, 'title' => $this->useButtonTag ? $this->description : null));
 }
开发者ID:jacobbuck,项目名称:silverstripe-framework,代码行数:5,代码来源:FormAction.php


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