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


PHP FormField::Title方法代码示例

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


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

示例1: setPlaceHolder

 /**
  * @param FormField $f
  * @param string $surfix
  * @return static
  */
 protected function setPlaceHolder(FormField $f, $surfix = '')
 {
     $str = $f->Title();
     if ($surfix) {
         $str .= " {$surfix}";
     }
     $f->setAttribute('placeholder', $str);
     return $this;
 }
开发者ID:kbrauer,项目名称:silverstripe-boilerplate,代码行数:14,代码来源:BaseForm.php

示例2:

 /**
  * Create a new nullable field
  * @param $valueField
  * @return NullableField
  */
 function __construct(FormField $valueField, $isNullLabel = null)
 {
     $this->valueField = $valueField;
     $this->isNullLabel = $isNullLabel;
     if (is_null($this->isNullLabel)) {
         // Set a default label if one is not provided.
         $this->isNullLabel = _t('NullableField.IsNullLabel', 'Is Null');
     }
     parent::__construct($valueField->getName(), $valueField->Title(), $valueField->Value(), $valueField->getForm(), $valueField->RightTitle());
     $this->readonly = $valueField->isReadonly();
 }
开发者ID:prostart,项目名称:cobblestonepath,代码行数:16,代码来源:NullableField.php

示例3: baseTransform

 /**
  * @param FormField $nonEditableField
  * @param FormField $originalField
  * @param string $fieldname
  * @return CompositeField
  */
 protected function baseTransform($nonEditableField, $originalField, $fieldname)
 {
     /** @var CompositeField $nonEditableField_holder */
     $nonEditableField_holder = CompositeField::create($nonEditableField);
     $nonEditableField_holder->setName($fieldname . '_holder');
     $nonEditableField_holder->addExtraClass('originallang_holder');
     $nonEditableField->setValue($this->original->{$fieldname});
     $nonEditableField->setName($fieldname . '_original');
     $nonEditableField->addExtraClass('originallang');
     $nonEditableField->setTitle(_t('Translatable_Transform.OriginalFieldLabel', 'Original {title}', 'Label for the original value of the translatable field.', array('title' => $originalField->Title())));
     $nonEditableField_holder->insertBefore($originalField, $fieldname . '_original');
     return $nonEditableField_holder;
 }
开发者ID:bummzack,项目名称:translatable-dataobject,代码行数:19,代码来源:TranslatableFormFieldTransformation.php

示例4: __construct

 /**
  * Create a new nullable field
  *
  * @param FormField $valueField
  * @param null|string $isNullLabel
  */
 public function __construct(FormField $valueField, $isNullLabel = null)
 {
     $this->valueField = $valueField;
     if (isset($isNullLabel)) {
         $this->setIsNullLabel($isNullLabel);
     } else {
         $this->isNullLabel = _t('NullableField.IsNullLabel', 'Is Null');
     }
     parent::__construct($valueField->getName(), $valueField->Title(), $valueField->Value());
     $this->setForm($valueField->getForm());
     $this->setRightTitle($valueField->RightTitle());
     $this->setReadonly($valueField->isReadonly());
 }
开发者ID:ntd,项目名称:sapphire,代码行数:19,代码来源:NullableField.php

示例5: transform

 public function transform(FormField $field)
 {
     if (!$field instanceof GridField) {
         throw new Exception(__CLASS__ . ' requires GridField FormField type.');
     }
     $title = $field->Title();
     $list = $field->getList();
     $config = $field->getConfig();
     $result = MultiRecordField::create($field->getName(), $title, $list);
     // Support: GridFieldExtensions (https://github.com/silverstripe-australia/silverstripe-gridfieldextensions)
     $gridFieldAddNewMultiClass = $config->getComponentsByType('GridFieldAddNewMultiClass')->first();
     if ($gridFieldAddNewMultiClass) {
         $classes = $gridFieldAddNewMultiClass->getClasses($field);
         $result->setModelClasses($classes);
     }
     return $result;
 }
开发者ID:silbinarywolf,项目名称:multirecordfield,代码行数:17,代码来源:MultiRecordTransformation.php

示例6: updateFormField

 /**
  * Updates a formfield with the additional metadata specified by this field
  *
  * @param FormField $field
  */
 protected function updateFormField($field)
 {
     // set the error / formatting messages
     $field->setCustomValidationMessage($this->getErrorMessage());
     // set the right title on this field
     if ($this->RightTitle) {
         // Since this field expects raw html, safely escape the user data prior
         $field->setRightTitle(Convert::raw2xml($this->RightTitle));
     }
     // if this field is required add some
     if ($this->Required) {
         // Required validation can conflict so add the Required validation messages as input attributes
         $errorMessage = $this->getErrorMessage()->HTML();
         $field->addExtraClass('requiredField');
         $field->setAttribute('data-rule-required', 'true');
         $field->setAttribute('data-msg-required', $errorMessage);
         if ($identifier = UserDefinedForm::config()->required_identifier) {
             $title = $field->Title() . " <span class='required-identifier'>" . $identifier . "</span>";
             $field->setTitle($title);
         }
     }
     // if this field has an extra class
     if ($this->ExtraClass) {
         $field->addExtraClass($this->ExtraClass);
     }
 }
开发者ID:camfindlay,项目名称:silverstripe-userforms,代码行数:31,代码来源:EditableFormField.php

示例7: Title

 public function Title()
 {
     $title = parent::Title();
     // Remove this method override in 4.0
     $decoded = Convert::xml2raw($title);
     if ($decoded !== $title) {
         Deprecation::notice('4.0', 'The FormAction title field should not be html encoded. Use buttonContent to set custom html instead');
         return $decoded;
     }
     return $title;
 }
开发者ID:jakedaleweb,项目名称:AtomCodeChallenge,代码行数:11,代码来源:FormAction.php

示例8: Title

 /**
  * Returns the field label if showing captcha - used by templates.
  * 
  * @return string Title if field is showing the captcha
  */
 public function Title()
 {
     if ($this->getShowCaptcha()) {
         return parent::Title();
     }
 }
开发者ID:helpfulrobot,项目名称:silverstripe-mollom,代码行数:11,代码来源:MollomField.php


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