Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/275.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
Php 只有变量应该通过引用-ckeditor-codeigniter传递_Php_Codeigniter_Ckeditor - Fatal编程技术网

Php 只有变量应该通过引用-ckeditor-codeigniter传递

Php 只有变量应该通过引用-ckeditor-codeigniter传递,php,codeigniter,ckeditor,Php,Codeigniter,Ckeditor,我尝试在我的codeigniter项目中使用ckeditor制作文本编辑器。但每当我从视图中调用方法display\u ckeditor时,我总是得到只有变量应该通过引用传递 这是我的错误日志: A PHP Error was encountered Severity: Runtime Notice Message: Only variables should be passed by reference Filename: helpers/ckeditor_helper.php Lin

我尝试在我的codeigniter项目中使用ckeditor制作文本编辑器。但每当我从视图中调用方法
display\u ckeditor
时,我总是得到
只有变量应该通过引用传递

这是我的错误日志:

A PHP Error was encountered

Severity: Runtime Notice

Message: Only variables should be passed by reference

Filename: helpers/ckeditor_helper.php

Line Number: 65

Backtrace:

File: /var/www/html/webapp/webappadmin/application/helpers/ckeditor_helper.php
Line: 65
Function: _error_handler

File: /var/www/html/webapp/webappadmin/application/helpers/ckeditor_helper.php
Line: 90
Function: cke_create_instance

File: /var/www/html/webapp/webappadmin/application/views/ubahabout.php
Line: 7
Function: display_ckeditor

File: /var/www/html/webapp/webappadmin/application/controllers/Controll.php
Line: 187
Function: view

File: /var/www/html/webapp/webappadmin/index.php
Line: 292
Function: require_once
这是我的加载视图控制器:

public function ubahabout($id,$tab,$lang){
    //Ckeditor's configuration
    $data['ckeditor'] = array(

        //ID of the textarea that will be replaced
        'id'    =>  'content',
        'path'  =>  'js/ckeditor',

        //Optionnal values
        'config' => array(
            'toolbar'   =>  "Full",     //Using the Full toolbar
            'width'     =>  "550px",    //Setting a custom width
            'height'    =>  '100px',    //Setting a custom height

        ),

        //Replacing styles from the "Styles tool"
        'styles' => array(

            //Creating a new style named "style 1"
            'style 1' => array (
                'name'      =>  'Blue Title',
                'element'   =>  'h2',
                'styles' => array(
                    'color'     =>  'Blue',
                    'font-weight'   =>  'bold'
                )
            ),

            //Creating a new style named "style 2"
            'style 2' => array (
                'name'  =>  'Red Title',
                'element'   =>  'h2',
                'styles' => array(
                    'color'         =>  'Red',
                    'font-weight'       =>  'bold',
                    'text-decoration'   =>  'underline'
                )
            )               
        )
    );
    $data['myid']=$id;
    $data['mylang']=$lang;
    $data['mytab']=$tab;
    $this->load->view('ubahabout',$data);    // <---- ERROR GOES HERE
}
ubahabout($id,$tab,$lang)公共函数{
//编辑配置
$data['ckeditor']=数组(
//将被替换的文本区域的ID
'id'=>'content',
'path'=>'js/ckeditor',
//可选值
'配置'=>数组(
'toolbar'=>“Full”,//使用完整工具栏
“宽度”=>“550px”,//设置自定义宽度
'height'=>'100px',//设置自定义高度
),
//从“样式工具”替换样式
“样式”=>数组(
//创建名为“样式1”的新样式
“样式1”=>数组(
“名称”=>“蓝色标题”,
“元素”=>“h2”,
“样式”=>数组(
“颜色”=>“蓝色”,
“字体重量”=>“粗体”
)
),
//创建名为“样式2”的新样式
“样式2”=>数组(
“名称”=>“红色标题”,
“元素”=>“h2”,
“样式”=>数组(
“颜色”=>“红色”,
“字体重量”=>“粗体”,
“文本装饰”=>“下划线”
)
)               
)
);
$data['myid']=$id;
$data['mylang']=$lang;
$data['mytab']=$tab;
$this->load->view('ubahabout',$data);//
示例数据

错误指向ckeditor\u helper.php中的第90行和第65行,我仍然无法找出问题所在。以下是ckeditor\u helper.php中的这些行:

第90行:
$return.=cke\u create\u实例($data);

第65行:
if($k!==end(数组_键($data['config'])){


请帮帮我。提前谢谢。

我认为

$this->load->view('ubahabout',$data);
是参考资料,请尝试:

$a = 'ubahabout';
$this->load->view($a, $data);
但是不确定,您还应该显示
$this->load->view

的定义,我也有这个问题, 问题不在于脚本,而在于文件“helpers/ckeditor_helper.php” 如错误消息所示

第65、108、116行各有相同的问题。 不是在“end()”中运行array_keys函数, 首先指定一个变量,然后在函数中使用该变量

helpers/ckeditor\u helper.php

64. $endkeys = (array_keys($data['config'])); 65. if($k !== end($endkeys)) { 64.$endkeys=(数组_键($data['config']); 65.如果($k!==end($endkeys)){ 107.$endkeys2=数组_键($v['style']); 108.如果($k2!==end($endkeys2)){ 115.$endkeys3=数组_键($data['style']); 116.如果($k!==end($endkeys3)){ 这应该解决这个问题

在system/helper中修改ckeditor_helper.php

  • $endkeys=(数组_键($data['config'])
  • 如果($k!==end($endkeys)){

  • $endkeys2=数组_键($v['style'])

  • 如果($k2!==end($endkeys2)){

  • $endkeys3=数组_键($data['style'])

  • 如果($k!==end($endkeys3)){
  • 151$endkeys=数组_值($key);152 if($string== end($endkeys))$return.=“,”

    160$endkeys=数组_值($data);161如果($key!=end($endkeys)) $return.=“,”

    64. $endkeys = (array_keys($data['config'])); 65. if($k !== end($endkeys)) { 107. $endkeys2 = array_keys($v['styles']); 108. if($k2 !== end($endkeys2)) { 115. $endkeys3 = array_keys($data['styles']); 116. if($k !== end($endkeys3)) {