當前位置: 首頁>>代碼示例>>PHP>>正文


PHP NumericField::addExtraClass方法代碼示例

本文整理匯總了PHP中NumericField::addExtraClass方法的典型用法代碼示例。如果您正苦於以下問題:PHP NumericField::addExtraClass方法的具體用法?PHP NumericField::addExtraClass怎麽用?PHP NumericField::addExtraClass使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在NumericField的用法示例。


在下文中一共展示了NumericField::addExtraClass方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: Field

 /**
  * Create the field for display in CMS.
  * 
  * (non-PHPdoc)
  * @see FormField::Field()
  * @return String
  */
 function Field()
 {
     $this->stockLevelField->setForm($this->form);
     if ($this->value == -1) {
         $this->stockLevelField->addExtraClass('HiddenStock');
     }
     return $this->stockLevelField->SmallFieldHolder();
 }
開發者ID:helpfulrobot,項目名稱:swipestripe-swipestripe,代碼行數:15,代碼來源:StockField.php

示例2: getQuantityField

 /**
  * @param String $label
  * @return NumericField
  */
 public function getQuantityField($label = '')
 {
     $f = new NumericField("Product[{$this->owner->ID}][Quantity]", $label);
     $f->setAttribute('type', Config::inst()->get('GroupedCartFormChildHooks', 'quantity_field_type'));
     $f->setAttribute('min', '0');
     $f->addExtraClass('grouped-quantity');
     return $f;
 }
開發者ID:helpfulrobot,項目名稱:markguinn-silverstripe-shop-groupedproducts,代碼行數:12,代碼來源:GroupedCartFormChildHooks.php

示例3: getFormField

 /**
  * @return NumericField
  */
 public function getFormField()
 {
     $field = new NumericField($this->Name, $this->Title);
     $field->addExtraClass('number');
     if ($field->Required) {
         // Required and numeric validation can conflict so add the
         // required validation messages as input attributes
         $errorMessage = $this->getErrorMessage()->HTML();
         $field->setAttribute('data-rule-required', 'true');
         $field->setAttribute('data-msg-required', $errorMessage);
     }
     return $field;
 }
開發者ID:vinstah,項目名稱:body,代碼行數:16,代碼來源:EditableNumericField.php

示例4: Field

 public function Field()
 {
     $valArr = $this->value ? explode('-', $this->value) : null;
     // fields
     $first = new NumericField($this->name . '[first]', false, $valArr ? array_shift($valArr) : null);
     $first->setMaxLength(3);
     $first->addExtraClass('ird-numeric');
     $second = new NumericField($this->name . '[second]', false, $valArr ? array_shift($valArr) : null);
     $second->setMaxLength(3);
     $second->addExtraClass('ird-numeric');
     $third = new NumericField($this->name . '[third]', false, $valArr ? array_shift($valArr) : null);
     $third->setMaxLength(3);
     $third->addExtraClass('ird-numeric');
     $fields = array($first->Field(), $second->Field(), $third->Field());
     $html = implode('<span style="padding: 0 8px">-</span>', $fields);
     return $html;
 }
開發者ID:helpfulrobot,項目名稱:silverstripe-formfields-nz,代碼行數:17,代碼來源:IrdNumberField.php

示例5: getFormField

 /**
  * @return TextareaField|TextField
  */
 public function getFormField()
 {
     if ($this->getSetting('Rows') && $this->getSetting('Rows') > 1) {
         $taf = new NumericField($this->Name, $this->Title);
         $taf->setRows($this->getSetting('Rows'));
         $taf->addExtraClass('number');
     } else {
         $taf = new NumericField($this->Name, $this->Title, null, $this->getSetting('MaxLength'));
         $taf->addExtraClass('number');
     }
     if ($this->Required) {
         //  Required and numeric validation can conflict so add the Required validation messages
         // as input attributes
         $errorMessage = $this->getErrorMessage()->HTML();
         $taf->setAttribute('data-rule-required', 'true');
         $taf->setAttribute('data-msg-required', $errorMessage);
     }
     return $taf;
 }
開發者ID:prostart,項目名稱:erics-homes,代碼行數:22,代碼來源:EditableNumericField.php

示例6: Field

 function Field()
 {
     // Three separate fields for day, month and year
     if ($this->getConfig('dmyfields')) {
         // values
         $valArr = $this->valueObj ? $this->valueObj->toArray() : null;
         // fields
         $fieldDay = new NumericField($this->name . '[day]', false, $valArr ? $valArr['day'] : null);
         $fieldDay->addExtraClass('day');
         $fieldDay->setMaxLength(2);
         $fieldMonth = new NumericField($this->name . '[month]', false, $valArr ? $valArr['month'] : null);
         $fieldMonth->addExtraClass('month');
         $fieldMonth->setMaxLength(2);
         $fieldYear = new NumericField($this->name . '[year]', false, $valArr ? $valArr['year'] : null);
         $fieldYear->addExtraClass('year');
         $fieldYear->setMaxLength(4);
         // order fields depending on format
         $sep = $this->getConfig('dmyseparator');
         $format = $this->getConfig('dateformat');
         $fields = array();
         $fields[stripos($format, 'd')] = $fieldDay->Field();
         $fields[stripos($format, 'm')] = $fieldMonth->Field();
         $fields[stripos($format, 'y')] = $fieldYear->Field();
         ksort($fields);
         $html = implode($sep, $fields);
     } else {
         $html = parent::Field();
     }
     return $html;
 }
開發者ID:SustainableCoastlines,項目名稱:loveyourwater,代碼行數:30,代碼來源:DateField.php

示例7: Field

 function Field($properties = array())
 {
     $config = array('showcalendar' => $this->getConfig('showcalendar'), 'isoDateformat' => $this->getConfig('dateformat'), 'jqueryDateformat' => DateField_View_JQuery::convert_iso_to_jquery_format($this->getConfig('dateformat')), 'min' => $this->getConfig('min'), 'max' => $this->getConfig('max'));
     // Add other jQuery UI specific, namespaced options (only serializable, no callbacks etc.)
     // TODO Move to DateField_View_jQuery once we have a properly extensible HTML5 attribute system for FormField
     foreach ($this->getConfig() as $k => $v) {
         if (preg_match('/^jQueryUI\\.(.*)/', $k, $matches)) {
             $config[$matches[1]] = $v;
         }
     }
     $config = array_filter($config);
     foreach ($config as $k => $v) {
         $this->setAttribute('data-' . $k, $v);
     }
     // Three separate fields for day, month and year
     if ($this->getConfig('dmyfields')) {
         // values
         $valArr = $this->valueObj ? $this->valueObj->toArray() : null;
         // fields
         $fieldDay = new NumericField($this->name . '[day]', false, $valArr ? $valArr['day'] : null);
         $fieldDay->addExtraClass('day');
         $fieldDay->setMaxLength(2);
         $fieldMonth = new NumericField($this->name . '[month]', false, $valArr ? $valArr['month'] : null);
         $fieldMonth->addExtraClass('month');
         $fieldMonth->setMaxLength(2);
         $fieldYear = new NumericField($this->name . '[year]', false, $valArr ? $valArr['year'] : null);
         $fieldYear->addExtraClass('year');
         $fieldYear->setMaxLength(4);
         // order fields depending on format
         $sep = $this->getConfig('dmyseparator');
         $format = $this->getConfig('dateformat');
         $fields = array();
         $fields[stripos($format, 'd')] = $fieldDay->Field();
         $fields[stripos($format, 'm')] = $fieldMonth->Field();
         $fields[stripos($format, 'y')] = $fieldYear->Field();
         ksort($fields);
         $html = implode($sep, $fields);
         // dmyfields doesn't work with showcalendar
         $this->setConfig('showcalendar', false);
     } else {
         $html = parent::Field();
     }
     return $html;
 }
開發者ID:nzjoel,項目名稱:sapphire,代碼行數:44,代碼來源:DateField.php

示例8: initFormField

 protected function initFormField()
 {
     $field = new NumericField($this->Name, $this->Title);
     $field->addExtraClass('number');
     return $field;
 }
開發者ID:helpfulrobot,項目名稱:satrun77-editablefield,代碼行數:6,代碼來源:EditableFieldNumeric.php


注:本文中的NumericField::addExtraClass方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。