本文整理匯總了PHP中Editor::setName方法的典型用法代碼示例。如果您正苦於以下問題:PHP Editor::setName方法的具體用法?PHP Editor::setName怎麽用?PHP Editor::setName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Editor
的用法示例。
在下文中一共展示了Editor::setName方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getEditorConfig
/**
* A convenience wrapper to create an Editor configuration
* bean. Allows for three sizes of editor, SMALL, MEDIUM, and LARGE.
* If no size is given, it will default to MEDIUM. Also accepts
* optional name and content.
*/
protected function getEditorConfig($size = null, $name = null, $content = null)
{
$size_opts = array(EDITOR::SMALL => "150", EDITOR::MEDIUM => "300", EDITOR::LARGE => "400");
$editor = new Editor();
$height = $size ? $size_opts[$size] : $size_opts[Editor::MEDIUM];
$editor->setHeight($height);
if ($name != null) {
$editor->setName($name);
}
if ($content != null) {
$editor->setContent($content);
}
return $editor;
}