CI 묻고 답하기

제목 Message: Only variables should be passed by reference 이 오류가 무엇인지???
글쓴이 kj 작성시각 2016/06/03 10:44:39
댓글 : 4 추천 : 0 스크랩 : 0 조회수 : 13491   RSS

Message: Only variables should be passed by reference 이 오류가 무엇인지 알려주세요..

 

Severity: Runtime Notice

Message: Only variables should be passed by reference

Filename: libraries/Widget.php

Line Number: 21

 

<?php (defined('BASEPATH')) OR exit('No direct script access allowed');

define('WIDGET', TRUE);

class Widget {    function __construct() {        $this->_assign_libraries();    }

    function run($controller) {        if (strpos($controller, '.') !== FALSE) {            list($controller, $method) = explode('.', $controller);        }

        require_once APPPATH.'controllers/'.$controller.EXT;

        // default method       

if (!isset($method)) $method = 'index';

        // class name       

$class = end(explode('/', $controller));  // 이부분 21번째 에러 

        if ($class =& new $class()) {            if (method_exists($class, $method)) {                           $args = func_get_args();                //return call_user_func_array(array(&$widget, 'index'), array_slice($args, 1));                            return call_user_func_array(array($class, $method), array_slice($args, 1));            }        }    }

    function _assign_libraries() {        $CI =& get_instance();        foreach (get_object_vars($CI) as $key => $object) {            $this->$key =& $CI->$key;        }    }}

 다음글 보안문자 이미지 출력 시, 로컬에서는 정상 출력되는데 ... (4)
 이전글 node js와 CI (12)

댓글

한대승(불의회상) / 2016/06/03 11:19:52 / 추천 0
php 버젼과 CI 버젼을 알려주세요.
kj / 2016/06/03 12:36:39 / 추천 0
CI버전 3.0.6 PHP 5.5.9 이예요.
한대승(불의회상) / 2016/06/03 13:04:10 / 추천 0
this->$key =& $CI->$key;  => this->$key = $CI->$key; 

처럼 수정후 테스트 해보세요.

kj / 2016/06/03 13:22:06 / 추천 0

이렇게 고치 는거 맞죠??

function _assign_libraries() {  

$CI =& get_instance();       

foreach (get_object_vars($CI) as $key => $object) { 

     $this->$key = $CI->$key;  

}   

 }

}