本文整理匯總了PHP中TextField::getName方法的典型用法代碼示例。如果您正苦於以下問題:PHP TextField::getName方法的具體用法?PHP TextField::getName怎麽用?PHP TextField::getName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類TextField
的用法示例。
在下文中一共展示了TextField::getName方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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;
}
示例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: createFrom
/**
* Create a new DomainSpecificEmailField based on the provided TextField.
* @param TextField $field
* @return DomainSpecificEmailField
*/
public static function createFrom(TextField $field)
{
return new self($field->getName(), $field->Title(), $field->Value(), $field->getMaxLength(), $field->getForm());
}