0
我有控制器和模型。我正在修改模型中的一个变量值,但它不反映在控制器中,我在OOP中并不那么专业。修改codeigniter模型中的变量值
// 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;
}
}
感谢您的帮助,但我在“插入”功能,从功能可按返回别的东西,所以我不能执行其他的事情写这一行“$ this-> total = $ this-> xml_model-> insert()”,因为插入函数做了很多事情,如果你不明白请让我知道,所以我可以显示你完整的代码。 –