本文整理匯總了PHP中HTMLEditorField::addExtraClass方法的典型用法代碼示例。如果您正苦於以下問題:PHP HTMLEditorField::addExtraClass方法的具體用法?PHP HTMLEditorField::addExtraClass怎麽用?PHP HTMLEditorField::addExtraClass使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類HTMLEditorField
的用法示例。
在下文中一共展示了HTMLEditorField::addExtraClass方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: GameFields
public function GameFields()
{
$fields = new FieldList();
// get current event
$siteConfig = SiteConfig::current_site_config();
$current = $siteConfig->getCurrentEventID();
$event = Event::get()->byID($current);
$genres = $this->getGroupedGames('Genre');
$fields->push(new HiddenField('ID'));
$fields->push(new TextField('Title'));
$fields->push(new TextField('Restriction', 'Restriction (R18, PG, etc)'));
// tag input field
$fields->push($tagfield = new TextField('Genre', 'Genres'));
$tagfield->addExtraClass('tag-field genre');
// hidden field for all current genres
$fields->push(new LiteralField('GenreList', $this->renderGenreList($genres)));
$briefEditor = new TextAreaField('Brief', 'Brief (Short Description)');
$briefEditor->setRows(5);
$fields->push($briefEditor);
$detailsEditor = CompositeField::create(new LabelField('GameDetails', 'Game Details'), $html = new HTMLEditorField('Details'), new LiteralField('editorDiv', '<div class="editable"></div>'));
$fields->push($detailsEditor);
$html->addExtraClass('hide');
$detailsEditor->addExtraClass('field');
$costuming = new TextAreaField('Costuming', 'Costuming');
$costuming->setRows(5);
$fields->push($costuming);
$fields->push(new TextField('NumPlayers', 'Number of players'));
$sessions = array();
if ($event) {
for ($i = 1; $i <= $event->NumberOfSessions; $i++) {
$sessions[$i] = $i;
}
$session = new DropdownField('Session', 'Preferred Session', $sessions);
$session->setEmptyString(' ');
$fields->push($session);
}
return $fields;
}