當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。