Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/laravel/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用CKEditor内部刀片模板[Laravel 3.x]_Laravel_Ckeditor_Laravel 3_Blade - Fatal编程技术网

使用CKEditor内部刀片模板[Laravel 3.x]

使用CKEditor内部刀片模板[Laravel 3.x],laravel,ckeditor,laravel-3,blade,Laravel,Ckeditor,Laravel 3,Blade,我想使用这个捆绑包: 但我在视图中嵌套它时遇到了麻烦(我以前成功完成的所有安装步骤)。 如何将Form::text()与此捆绑包连接 当我加上 <?php $ckeditor = new CKEditor(); $config = array(); $config['toolbar'] = array( array( 'Source', '-', 'Bold', 'Italic', 'Underline', 'Str

我想使用这个捆绑包: 但我在视图中嵌套它时遇到了麻烦(我以前成功完成的所有安装步骤)。 如何将Form::text()与此捆绑包连接

当我加上

<?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);
    ?>

以下是一个工作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::label('title','Tytuł'')}

{{$errors->first('title','×:message')} {{Form::text('title',$value=$post->title,$attributes=array(Input::old('title'));}

{{Form::label('body','Tekst')}

{{$errors->first('body','×:message')} {{RTE::富文本框('body',$post->body,数组('att'=>array('id'=>'editorID'),'selector'=>'editorSelector','mode'=>'full','setup'=>array('skin'=>'o2k7','skin\u variant'=>'black'))}

{{Form::submit('Edit')}

诀窍是使用它而不是Form::text(并更改0755的/laravel/public/bundles/*中的所有文件权限)
同样的事情也发生在Keckeditor身上。希望它能在将来帮助别人(:

步骤如下:

  • 通过运行以下命令,首先通过composer安装编辑器:

    编写器需要unisharp/laravel ckeditor

  • 将此添加到
    config/app.php
    中的ServiceProvider到providers数组中:
    'providers'=>[

    Unisharp\Ckeditor\ServiceProvider::class,

  • 再次回到命令行,发布资源

    php artisan供应商:发布--tag=ckeditor

  • 现在将其嵌入
    文本区域
    id绑定

  • 
    CKEDITOR.replace('your_id');
    
    
    
    对于这些步骤,他们有自己的步骤



    注意:如果您使用Laravel Collictive添加文本区域并将
    id
    绑定到文本区域,请使用以下命令:

    {{Form::textarea('desc', '', ['id' => 'your_id'])}}
    
    然后显示格式良好的内容,如下所示:

    {!!$post->desc!!}
    
    其中
    $post->desc
    是从数据库返回的存储值

    我也尝试过,但不知道如何正确使用它:(