Php 在Codeigniter中,当我将变量从控制器传递到模型时,为什么变量会损坏

Php 在Codeigniter中,当我将变量从控制器传递到模型时,为什么变量会损坏,php,codeigniter,Php,Codeigniter,我很生气 我将一个变量从一个控制器方法传递到另一个方法,在传递过程中它不知怎么地发生了变化。最初它被愚蠢地称为$id。。所以我想可能会有一些可变的干扰。。但我已经更改了名称,问题仍然存在 有人能告诉我可能发生什么事吗 这是密码。。检查我的评论 public function firstFbLogin() { ChromePhp::log('AJAX - first FB login'); // logs fine $username = $this->i

我很生气

我将一个变量从一个控制器方法传递到另一个方法,在传递过程中它不知怎么地发生了变化。最初它被愚蠢地称为
$id
。。所以我想可能会有一些可变的干扰。。但我已经更改了名称,问题仍然存在

有人能告诉我可能发生什么事吗

这是密码。。检查我的评论

public function firstFbLogin()
{
    ChromePhp::log('AJAX - first FB login');  // logs fine
    $username          = $this->input->post('username');
    $first_name        = $this->input->post('first_name');
    $last_name         = $this->input->post('last_name');
    $facebookId        = $this->input->post('facebookId');
    $email             = $this->input->post('email');
    $third_party_id    = $this->input->post('third_party_id');
    $gender         = $this->input->post('gender');
    $this->Member_model->mFirstFbLogin($username, $first_name, $last_name, $email, $facebookId, $third_party_id, $gender);
            // here comes the issue..
    $idFromFbDooDaDay = $this->Member_model->mFetchIdFromFacebook($facebookId);
    ChromePhp::log("Id found and going out of ajax - firstFbLogin is ". $idFromFbDooDaDay); // <<< this logs 232 which is what I am expecting
    $this->Member_model->mCreateProfilePage($username, $first_name, $last_name, $idFromFbDooDaDay, $third_party_id, $gender);
    echo "TRUE";
}
公共函数firstFbLogin()
{
ChromePhp::log('AJAX-first FB login');//日志很好
$username=$this->input->post('username');
$first_name=$this->input->post('first_name');
$last_name=$this->input->post('last_name');
$facebookId=$this->input->post('facebookId');
$email=$this->input->post('email');
$third_party_id=$this->input->post('third_party_id');
$SENDER=$this->input->post('SENDER');
$this->Member\u model->mFirstFbLogin($username、$first\u name、$last\u name、$email、$facebook id、$third\u party\u id、$gender);
//问题来了。。
$IDFromfBdooday=$this->Member\u model->mFetchIdFromFacebook($facebookId);
ChromePhp::log(“找到Id并退出ajax-firstFbLogin为“$IDFromfBdooday”)//mCreateProfilePage($username、$first\u name、$last\u name、$IDFromfBdooday、$third\u party\u Id、$gender);
呼应“真”;
}
但是,在我的会员模式中,我有这个(我将编辑一组)

public function mCreateProfilePage($username、$first\u name、$last\u name、$gender、$idFromfbdoday、$third\u party\u id)
{
//让我们创建一个用于FB对象交互的“profile.html”
$this->load->helper('file');
ChromePhp::log('进入McCreateProfilePage的Id为'$IDFromfBdooday);//此日志为D0k9f7LxtjIHMhGnbn6UkhDk3ao WTF!?!
$data=“\n”;
$data.=“\n”;
$data.=“\n”//我的应用程序ID
$data.=“\n”//保留配置文件
$data.=“\n”//放置URL
$data.=“\n”//bigPic的url
编辑
$file_path='profiles/id-'。$idFromfBdooday..html';
如果(!write_file($file_path,$data))
{
ChromePhp::log(“写配置文件时出现问题”);
}
其他的
{
ChromePhp::log('配置文件写入'.$file\u路径);
}
}
那么,在从控制器到模型的简单过程中,
$idFromfBdooday=232
是如何变成一个27个字符的噩梦的呢

这不可能是可变干扰。。就我所见,没有其他东西能触及var。怎么了

// $this->Member_model->
mCreateProfilePage($username, $first_name, $last_name, $idFromFbDooDaDay, $third_party_id, $gender);
// public function 
mCreateProfilePage($username, $first_name, $last_name, $gender, $idFromFbDooDaDay, $third_party_id)
您的参数不匹配,这可能是原因:)


您的参数不匹配,这可能就是原因:)

在这些情况下,最简单的方法是使用调试工具(如xDebug)并遵循变量的路径。然后,您可以在每个步骤中看到它,并查看它是否正在被修改。:)我同意,但我使用的是OSX 10.6,安装起来很棘手。在这种情况下,最简单的方法是使用调试工具,如xDebug,并遵循变量的路径。然后,您可以在每个步骤中看到它,并查看它是否正在被修改。:)我同意,但我使用的是OSX 10.6,安装起来很棘手。
// $this->Member_model->
mCreateProfilePage($username, $first_name, $last_name, $idFromFbDooDaDay, $third_party_id, $gender);
// public function 
mCreateProfilePage($username, $first_name, $last_name, $gender, $idFromFbDooDaDay, $third_party_id)