0
컨트롤러와 모델이 있습니다. 모델의 변수 값을 수정하고 있지만 컨트롤러에 반영되지는 않지만 OOP에서는 많은 전문가가 아닙니다.코드 명 모델에서 변수 값 수정
// controller class structure
class Leads_import extends CI_Controller {
public $total = 0;
public function import(){
$this->xml_model->imsert();
echo $this->total;
}
}
// model class structure
class xml_model extends CI_Model {
public function insert(){
this->total = 10;
}
}
감사하지만 난 기능과 그 funciton에서 뭔가를 돌려 질수 있도록 "삽입"다른 일을 수행하고있다 : 여기
당신이 정말로 뭘 하려는지 알지 못하고 내가 제안 무엇 삽입 함수가 많은 일을하기 때문에이 줄을 "$ this-> total = $ this-> xml_model-> insert()"라고 쓰십시오. 이해가 안되면 알려 주시기 바랍니다. –