CI 묻고 답하기

제목 컨트롤러에서 모델 호출이 안되는 문제
글쓴이 바보돌쇠 작성시각 2012/09/05 12:57:16
댓글 : 2 추천 : 0 스크랩 : 0 조회수 : 14900   RSS
검색 시 사용자 정보드의 값을 DB에 insert 하도록 하려는데, 오류가 나네요

뭣 땜에 오류가 나는지 몰라서 헤매고 있습니다.

고수님들께서 좀 도와 주세요...


오류 내용은

Severity: Notice

Message: Undefined property: Search::$encrypt

Filename: core/Model.php

Line Number: 51

컨트롤러 부분::

class Search extends CI_Controller {

function __construct() {

parent::__construct();

define('WIDGET_SKIN', 'main');

define('CSS_SKIN', 'style');

$this->load->model('M_mms_info');

}

        function update() {

         // 검색이용자 정보 INSERT

$this->M_mms_info->insert();

goto_url('/search/step01');

}


모델 부분::

class M_mms_info extends CI_Model {

function __construct() {

parent::__construct();

}

function insert() {

$sql = array(

'search_type'  => $this->input->post('searchtype'),

'user_company' => $this->input->post('corpname'),

'user_name'    => $this->encrypt->encode($this->input->post('username')),
                             $this->input->post('username'),

'user_tel'     => $this->input->post('usertel'),

'user_ip'      => $this->input->server('REMOTE_ADDR'),

'write_date'   => TIME_YMDHIS

);

$this->db->insert('MMS_info', $sql);

}

}

 

 다음글 [초보]index.php 제거 질문입니다. (6)
 이전글 포럼 소스보면서 궁금한게 있습니다. [세션 로드] (2)

댓글

변종원(웅파) / 2012/09/05 13:06:42 / 추천 0
 $this->encrypt->encode    <-- 선언 먼저 하셨는지요? encrypt library
바보돌쇠 / 2012/09/05 13:17:46 / 추천 0
웅파님, 감사합니다.

다른 모델에서 잘라 붙이면서 제대로 수정을 안했네요... ㅡㅡ;