本文整理汇总了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;
}