在刀片模板[Laravel 3.x]中使用CKEditor [英] Using CKEditor inside blade template [Laravel 3.x]

查看:81
本文介绍了在刀片模板[Laravel 3.x]中使用CKEditor的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用此捆绑包: laravel-ckeditor 但我在将其嵌套在视图中时遇到了麻烦(我已经成功完成了之前的所有安装步骤). 如何将Form :: text()与该捆绑包连接?

I'd like to use this bundle: laravel-ckeditor but I have troubles in nesting it in my view (all previous installation steps I've done successfully). How can i connect Form::text() with this bundle?

当我添加

<?php 
        $ckeditor = new CKEditor();
        $config = array();
        $config['toolbar'] = array(
            array( 'Source', '-', 'Bold', 'Italic', 'Underline', 'Strike' ),
            array( 'Image', 'Link', 'Unlink', 'Anchor' )
        );
        $events['instanceReady'] = 'function (ev) {
            alert("Loaded: " + ev.editor.name);
        }';
        $ckeditor->editor("field1", "
        Initial value.

        ", $config, $events);
    ?>

它只是创建新的文本区域,但不幸的是没有任何富文本功能... 有人遇到这个问题了吗?

it simply creates new text area but unfortunately without any richtext functionality... Does anyone has already met this problem?

推荐答案

以下是运行TinyMCE的示例:

here is an example of working TinyMCE:

<!-- title field -->
    <p>{{ Form::label('title', 'Tytuł') }}</p>
    {{ $errors->first('title', '<div class="alert alert-error"><a class="close">×</a>:message</div>') }}
    <p>{{ Form::text('title', $value = $post->title, $attributes = array(Input::old('title'))); }}</p>
<!-- body field -->
<p>{{ Form::label('body', 'Tekst') }}</p>
        {{ $errors->first('body', '<div class="alert alert-error"><a class="close">×</a>:message</div>') }}
        <p>{{ RTE::rich_text_box('body',$post->body,array('att'=>array('id'=>'editorID'),'selector'=>'editorSelector','mode'=>'full','setup'=>array('skin'=>'o2k7','skin_variant'=>'black'))) }}
        </p>
    <!-- submit button -->
        <p>{{ Form::submit('Edit') }}</p>

诀窍是使用它的Form :: text INSTEAD(然后将/laravel/public/bundles/*中的所有文件权限更改为0755) CKEditor也是如此.希望它将对以后的其他人有所帮助(:

the trick was to use it INSTEAD of Form::text (and change all file permissions in /laravel/public/bundles/* for 0755) the same thing was about CKEditor. hope it will help others in a future (:

这篇关于在刀片模板[Laravel 3.x]中使用CKEditor的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆