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


PHP TextField::setName方法代码示例

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


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

示例1: getCMSFields

 public function getCMSFields()
 {
     $oFieldExternalLink = new TextField('LinkExternalUrl', 'Externe link (opent in nieuw venster, begin met http://)', $this->LinkExternalUrl);
     $name = $oFieldExternalLink->getName();
     $name = preg_replace("/([A-Za-z0-9\\-_]+)/", "Widget[" . $this->ID . "][\\1]", $name);
     $oFieldExternalLink->setName($name);
     $oFieldInternalLink = new SimpleTreeDropdownField('InternalUrlID', 'Interne link', 'SiteTree', $this->InternalUrlID, null, 'Kies een pagina');
     $name = $oFieldInternalLink->getName();
     $name = preg_replace("/([A-Za-z0-9\\-_]+)/", "Widget[" . $this->ID . "][\\1]", $name);
     $oFieldInternalLink->setName($name);
     $aSelectionGroupItems = array(new SelectionGroup_Item('none', new LiteralField('nolink', ''), 'Geen link'), new SelectionGroup_Item('internal', $oFieldInternalLink, 'Interne link'), new SelectionGroup_Item('external', $oFieldExternalLink, 'Externe link'));
     $fldSelectionGroup = new SelectionGroup('LinkType', $aSelectionGroupItems);
     // config htmleditor
     // make a new TinyMCE config called "footer" by copying the default ("cms") config
     /*
     		$footerConfig = CustomHtmlEditorConfig::copy('simpletoolbar', 'cms');
     		$footerConfig->setButtonsForLine(3, array());
     		$footerConfig->setButtonsForLine(2, array());
     */
     $oFields = new FieldList(new TextField('Header', 'Titel'), $fldBody = new HtmlEditorField('Body', 'Inhoud'), new HeaderField('hdrLink', 'Link', 3), new TextField('LinkTxt', 'Tekst link'), $fldSelectionGroup);
     $fldBody->setRows(6);
     // assign the "footer" TinyMCE config to this field
     $fldBody->setEditorConfig('simpletoolbar');
     // set the editor's body class.  This will make it class="typography footer-content"
     $fldBody->setBodyClass('widget_text typograhy');
     return $oFields;
 }
开发者ID:hamaka,项目名称:hamaka-widgets,代码行数:27,代码来源:TextWidget.php

示例2: getColumnContent

 /**
  * HTML for the column, content of the <td> element.
  *
  * @param  GridField $gridField
  * @param  DataObject $record - Record displayed in this row
  * @param  string $columnName
  * @return string - HTML for the column. Return NULL to skip.
  */
 public function getColumnContent($gridField, $record, $columnName)
 {
     $field = new TextField('MetaTitle');
     $value = $gridField->getDataFieldValue($record, $columnName);
     $value = $this->formatValue($gridField, $record, $columnName, $value);
     $field->setName($this->getFieldName($field->getName(), $gridField, $record));
     $field->setValue($value);
     return $field->Field() . $this->getErrorMessages();
 }
开发者ID:helpfulrobot,项目名称:littlegiant-silverstripe-seo-editor,代码行数:17,代码来源:SEOEditorMetaTitleColumn.php

示例3: setName

 /**
  * @param string $name
  *
  * @return AddressFinderField
  */
 public function setName($name)
 {
     parent::setName($name);
     $this->addressField->setName("{$name}[Address]");
     foreach ($this->getManualFields() as $field) {
         $nested = $this->getNestedFieldName($field);
         $field->setName("{$name}[{$nested}]");
     }
     return $this;
 }
开发者ID:fullscreeninteractive,项目名称:silverstripe-addressfinder,代码行数:15,代码来源:AddressFinderField.php

示例4: TitleField

 /**
  * Title field of the field in the backend of the page
  *
  * @return TextField
  */
 public function TitleField()
 {
     $label = _t('EditableFormField.ENTERQUESTION', 'Enter Question');
     $field = new TextField('Title', $label, $this->getField('Title'));
     $field->setName($this->getFieldName('Title'));
     if (!$this->canEdit()) {
         return $field->performReadonlyTransformation();
     }
     return $field;
 }
开发者ID:nzjoel,项目名称:silverstripe-userforms,代码行数:15,代码来源:EditableFormField.php

示例5: TitleField

 /**
  * Title field of the field in the backend of the page
  *
  * @return TextField
  */
 function TitleField()
 {
     //do not XML escape the title field here, because that would result in a recursive escaping of the escaped text on every save
     $field = new TextField('Title', _t('EditableFormField.ENTERQUESTION', 'Enter Question'), $this->getField('Title'));
     $field->setName($this->getFieldName('Title'));
     if (!$this->canEdit()) {
         return $field->performReadonlyTransformation();
     }
     return $field;
 }
开发者ID:notioncollective,项目名称:silverstripe-userforms,代码行数:15,代码来源:EditableFormField.php

示例6: TitleField

 /**
  * Title field of the field in the backend of the page
  *
  * @return TextField
  */
 function TitleField()
 {
     $field = new TextField('Title', _t('EditableFormField.ENTERQUESTION', 'Enter Question'), Convert::raw2att($this->Title));
     $field->setName($this->getFieldName('Title'));
     if (!$this->canEdit()) {
         return $field->performReadonlyTransformation();
     }
     return $field;
 }
开发者ID:SustainableCoastlines,项目名称:loveyourwater,代码行数:14,代码来源:EditableFormField.php

示例7: getTextField

 /**
  * Generate TextField object
  *
  * @param string $name
  * @param string $title
  * @return TextField 
  */
 protected function getTextField($name, $title)
 {
     $label = _t('EditableField.FIELDNAME', $title);
     $field = new TextField($name, $label, $this->getField($name));
     $field->setName($this->getFieldName($name));
     $field->addExtraClass('small');
     $field->setAttribute('placeholder', $label);
     return $field;
 }
开发者ID:helpfulrobot,项目名称:satrun77-editablefield,代码行数:16,代码来源:EditableField.php


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