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


PHP TextField::getAttributes方法代码示例

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


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

示例1: getAttributes

 public function getAttributes()
 {
     if ($this->getPage()->isMainSite()) {
         return parent::getAttributes();
     }
     return array_merge(TextField::getAttributes(), array('data-prefix' => $this->getURLPrefix(), 'data-suffix' => '?stage=', 'data-default-url' => $this->getDefaultURL()));
 }
开发者ID:otago,项目名称:subsites-domains,代码行数:7,代码来源:SubsiteSiteTreeURLSegmentField.php

示例2: getAttributes

 /**
  * @return array
  */
 public function getAttributes()
 {
     $attributes = [];
     $attributes['type'] = 'number';
     $attributes['autocomplete'] = 'off';
     $attributes['required'] = 'required';
     return array_merge(parent::getAttributes(), $attributes);
 }
开发者ID:axllent,项目名称:silverstripe-enquiry-page,代码行数:11,代码来源:CaptchaField.php

示例3: getAttributes

	function getAttributes() {
		return array_merge(
			parent::getAttributes(),
			array(
				'type' => 'email'
			)
		);
	}
开发者ID:redema,项目名称:sapphire,代码行数:8,代码来源:EmailField.php

示例4: getAttributes

 /**
  * Set additional attributes
  * @return array Attributes
  */
 public function getAttributes()
 {
     $attributes = array('placeholder' => $this->config['defaultparts']['scheme'] . "://example.com");
     if ($this->config['html5validation']) {
         $attributes += array('type' => 'url', 'pattern' => 'https?://.+');
     }
     return array_merge(parent::getAttributes(), $attributes);
 }
开发者ID:helpfulrobot,项目名称:burnbright-silverstripe-externalurlfield,代码行数:12,代码来源:ExternalURLField.php

示例5: getAttributes

 public function getAttributes()
 {
     $attributes = array_merge(parent::getAttributes(), array('type' => 'password'));
     $autocomplete = Config::inst()->get('PasswordField', 'autocomplete');
     if (isset($autocomplete)) {
         $attributes['autocomplete'] = $autocomplete ? 'on' : 'off';
     }
     return $attributes;
 }
开发者ID:jakedaleweb,项目名称:AtomCodeChallenge,代码行数:9,代码来源:PasswordField.php

示例6: getAttributes

 /**
  * @return Array
  */
 public function getAttributes()
 {
     $attributes = array_merge(parent::getAttributes(), array('type' => 'hidden', 'data-searchurl' => $this->Link('search'), 'data-minimuminputlength' => $this->getConfig('minimumInputLength'), 'data-resultslimit' => $this->getConfig('resultsLimit'), 'data-placeholder' => $this->getConfig('placeholder'), 'data-multiple' => $this->getConfig('multiple')));
     if ($this->Value() && ($object = DataObject::get($this->getConfig('classToSearch'))->byID($this->Value()))) {
         $originalSourceFileComments = Config::inst()->get('SSViewer', 'source_file_comments');
         Config::inst()->update('SSViewer', 'source_file_comments', false);
         $attributes['data-selectioncontent'] = html_entity_decode(SSViewer::fromString($this->getConfig('selectionFormat'))->process($object));
         Config::inst()->update('SSViewer', 'source_file_comments', $originalSourceFileComments);
     }
     return $attributes;
 }
开发者ID:sheadawson,项目名称:silverstripe-select2,代码行数:14,代码来源:AjaxSelect2Field.php

示例7: getAttributes

 /**
  * {@inheritdoc}
  */
 public function getAttributes()
 {
     $attributes = array('type' => 'password');
     $autocomplete = Config::inst()->get('PasswordField', 'autocomplete');
     if ($autocomplete) {
         $attributes['autocomplete'] = 'on';
     } else {
         $attributes['autocomplete'] = 'off';
     }
     return array_merge(parent::getAttributes(), $attributes);
 }
开发者ID:ivoba,项目名称:silverstripe-framework,代码行数:14,代码来源:PasswordField.php

示例8: getAttributes

 /**
  * @return array
  */
 function getAttributes()
 {
     return array_merge(parent::getAttributes(), array('data-source' => $this->getSuggestURL(), 'data-min-length' => $this->getMinSearchLength(), 'data-require-selection' => $this->getRequireSelection(), 'autocomplete' => 'off', 'name' => $this->getName() . '__autocomplete'));
 }
开发者ID:nyeholt,项目名称:silverstripe-autocomplete,代码行数:7,代码来源:AutoCompleteField.php

示例9: getAttributes

 function getAttributes()
 {
     $this->extraClasses[] = 'text';
     if (isset($_GET)) {
         $query = $_GET;
         if (isset($query['url'])) {
             unset($query['url']);
         }
         $query = http_build_query($query);
     } else {
         $query = '';
     }
     $attributes = array_merge(['data-suggest-url' => $this->SuggestURL ? Controller::join_links($this->SuggestURL, '?' . $query, sprintf('?%s=%%QUERY', $this->queryKey)) : false, 'data-prefetch-url' => $this->PrefetchURL ? Controller::join_links($this->PrefetchURL, '?' . $query) : false, 'data-min-length' => $this->minSearchLength, 'data-require-selection' => $this->requireSelection, 'data-name' => strtolower($this->ID()), 'data-templates.empty' => _t('TypeAheadField.NO_MATCHES', 'No matches found')], parent::getAttributes(), ['autocomplete' => 'off']);
     if (!$this->form || !$this->SuggestURL && !$this->PrefetchURL || is_array($this->SourceList)) {
         if ($list = $this->SourceList) {
             $results = $this->results('', $list, null, false);
         } else {
             $results = [];
         }
         $attributes['data-local'] = json_encode($results);
     }
     if (is_array($this->SourceList)) {
         unset($attributes['data-suggest-url']);
         unset($attributes['data-prefetch-url']);
     }
     return $attributes;
 }
开发者ID:helpfulrobot,项目名称:milkyway-multimedia-ss-mwm-autocomplete,代码行数:27,代码来源:TypeAheadField.php

示例10: getAttributes

	function getAttributes() {
		return array_merge(
			parent::getAttributes(),
			array('type' => 'password')
		);
	}
开发者ID:redema,项目名称:sapphire,代码行数:6,代码来源:PasswordField.php

示例11: getAttributes

 public function getAttributes()
 {
     $attrs = parent::getAttributes();
     return array_merge($attrs, array('type' => $this->EditableField() ? 'text' : 'hidden'));
 }
开发者ID:helpfulrobot,项目名称:lekoala-silverstripe-form-extras,代码行数:5,代码来源:SliderField.php

示例12: getAttributes

 /**
  * @return array
  */
 public function getAttributes()
 {
     $atts = array_merge(parent::getAttributes(), array('data-source' => $this->getSuggestURL(), 'data-min-length' => $this->getMinSearchLength(), 'data-require-selection' => $this->getRequireSelection(), 'autocomplete' => 'off', 'name' => $this->getName() . '__autocomplete', 'placeholder' => 'Search on ' . implode(' or ', $this->getSourceFields())));
     // Unset the value so we start with a clear search form
     $atts['value'] = null;
     return $atts;
 }
开发者ID:tractorcow,项目名称:silverstripe-autocomplete,代码行数:10,代码来源:AutoCompleteField.php

示例13: getAttributes

 /**
  * {@inheritDoc}
  */
 public function getAttributes()
 {
     return array_merge(parent::getAttributes(), array('value' => $this->getOption('always_empty') && !$this->isBound() ? '' : $this->getDisplayedData(), 'type' => 'password'));
 }
开发者ID:rsky,项目名称:symfony,代码行数:7,代码来源:PasswordField.php

示例14: getAttributes

 public function getAttributes()
 {
     return array_merge(parent::getAttributes(), array('data-prefix' => $this->getURLPrefix(), 'data-suffix' => '?stage=Stage'));
 }
开发者ID:prostart,项目名称:erics-homes,代码行数:4,代码来源:SiteTreeURLSegmentField.php

示例15: getAttributes

 /**
  * Returns the attributes
  * 
  * @return array
  */
 public function getAttributes()
 {
     return array_merge(parent::getAttributes(), array('placeholder' => $this->getPlaceholder()));
 }
开发者ID:silvercart,项目名称:silvercart,代码行数:9,代码来源:SilvercartTextField.php


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