本文整理汇总了PHP中field::textarea方法的典型用法代码示例。如果您正苦于以下问题:PHP field::textarea方法的具体用法?PHP field::textarea怎么用?PHP field::textarea使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类field
的用法示例。
在下文中一共展示了field::textarea方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: codemirror
function codemirror($attrs)
{
$url = zotop::module('codemirror', 'url');
$options = new stdClass();
$options->path = $url . '/codemirror/js/';
$options->parserfile = array('parsexml.js');
$options->stylesheet = array($url . '/codemirror/css/xmlcolors.css');
$options->height = is_numeric($attrs['height']) ? $attrs['height'] . 'px' : $attrs['height'];
$options->width = is_numeric($attrs['width']) ? $width . 'px' : $attrs['width'];
$options->continuousScanning = 500;
$options->autoMatchParens = true;
if ($attrs['linenumbers'] !== false) {
$options->lineNumbers = true;
$options->textWrapping = false;
}
if ($attrs['tabmode'] == '') {
$options->tabMode = 'shift';
}
$html = array();
$html[] = html::script($url . '/codemirror/js/codemirror.js');
$html[] = html::stylesheet($url . '/codemirror/css/codemirror.css');
$html[] = ' ' . field::textarea($attrs);
$html[] = '<script type="text/javascript">';
$html[] = ' var editor = CodeMirror.fromTextArea("' . $attrs['name'] . '", ' . json_encode($options) . ');';
$html[] = '$(function(){';
$html[] = ' $("form").submit(function(){';
$html[] = ' $("textarea[name=+' . $attrs['name'] . '+]").val(editor.getCode());';
$html[] = ' });';
$html[] = '})';
$html[] = '</script>';
return implode("\n", $html);
}
示例2: source
public static function source($attrs)
{
$html = array();
$html[] = '';
$html[] = '<div style="height:460px;overflow:hidden;">';
$html[] = '<div id="SourceEditorPannel">正在加载编辑器,请稍后……</div>';
$html[] = html::script(url::common() . '/js/swfobject.js');
$html[] = html::script(url::module() . '/admin/js/file.js');
$html[] = field::textarea($attrs);
$html[] = '</div>';
return implode("\n", $html);
}
示例3: xheditor_rc1
function xheditor_rc1($attrs)
{
$attrs['class'] = isset($attrs['class']) ? 'editor ' . $attrs['class'] : 'editor';
$tools = array('image' => '<a href="' . zotop::url('system/image/upload') . '" class="button editor-insert" name="' . $attrs['name'] . '"><span class="zotop-icon zotop-icon-imageuploader button-icon"></span><span class="button-text">插入图片</span></a>', 'file' => '<a href="' . zotop::url('system/file/upload') . '" class="button editor-insert" name="' . $attrs['name'] . '"><span class="zotop-icon zotop-icon-fileuploader button-icon"></span><span class="button-text">插入文件</span></a>', 'template' => '<a href="' . zotop::url('system/file/upload') . '" class="button editor-insert" name="' . $attrs['name'] . '"><span class="zotop-icon zotop-icon-template button-icon"></span><span class="button-text">插入模板</span></a>');
$tools = zotop::filter('editor.tools', $tools);
$tools = arr::take('tools', $attrs) === false ? array() : $tools;
$url = zotop::module('xheditor', 'url');
$html[] = html::script($url . '/editor/xheditor-zh-cn.min.js');
$html[] = html::script($url . '/common/global.js');
if (is_array($tools) && !empty($tools)) {
$html[] = '<div class="field-toolbar">';
foreach ($tools as $tool) {
$html[] = ' ' . $tool;
}
$html[] = '</div>';
}
$html[] = ' ' . field::textarea($attrs);
return implode("\n", $html);
}
示例4: source
public static function source($attrs)
{
$attrs['style'] = 'width:600px;height:460px;';
return field::textarea($attrs);
}
示例5: editor
/**
* 富文本编辑器
*
* @param $attrs array 控件参数
* @return string 控件代码
*/
public static function editor($attrs)
{
return field::textarea($attrs);
}