만들면서 배우는 CodeIgniter Q&A

제목 사용자 라이브러리 사용할때 문제..
글쓴이 인수 작성시각 2014/02/14 22:36:47
댓글 : 3 추천 : 0 스크랩 : 0 조회수 : 8652   RSS
- application/libraries/Someclass.php
<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Someclass {
  public function some_function() {
    return '사용자 라이브러리';
  }
}
?>

-application/controllers/lib_test.php
<?php
      $this -> load -> library('someclass');
      $value = $this -> someclass -> some_function();
      echo $value;
?>

이러할때...
밑의 오류가 납니다..
Array ( [type] => 1 [message] => Using $this when not in object context [file] => 파일경로
someclass라이브러리를 로딩못하는데 어찌해야 하나요??
 다음글 [65페이지]오탈자인가요? (1)
 이전글 p87쪽 $table='ci_board' 이 구문이 뜻... (1)

댓글

인수 / 2014/02/14 22:38:55 / 추천 0
 혹시나 버전때문인가 해서 적어둡니다. PHP 5.3.26 입니다.
변종원(웅파) / 2014/02/16 11:55:11 / 추천 0
쓰신 형식은 맞습니다. 
(컨트롤러는 제대로 형식 맞춰 쓰신거죠? 올려주신 형태가 아니구요?)
올려주신 컨트롤러 소스라면 안되는게 맞습니다.
매뉴얼 다시 참고요.
인수 / 2014/02/16 17:40:25 / 추천 0
 답변 감사합니다.~