我正在做symfony1项目,我得到了这个异常。有谁知道是什么原因造成的吗?
注意:第1183行的C:\wamp\www\gazette\apps\GAZ\modules\jobAppliance\actions\actions.class.php中的数组到字符串的转换
public function executeSaveCandidateJsni()
{
$jobId = $this->getRequestParameter('job_id');
$job = JobPeer::retrieveByPK($jobId);
// Sauvegarde des objets jobAppliance et de jobApplianceAttachedFile
$listJApplianceAttachedCV = $this->getUser()->getAttribute('list_job_appliance_attached_cv');
// ***this is line 1183***
sfContext::getInstance()->getLogger()->debug('(Jsni) $listJApplianceAttachedCV = ' .$listJApplianceAttachedCV); // ***this is line 1183***
$listJApplianceAttachedFile = $this->getUser()->getAttribute('list_job_appliance_attached_file');
sfContext::getInstance()->getLogger()->debug('(Jsni) $listJApplianceAttachedFile = ' .$listJApplianceAttachedFile); //
$listDetailForm = $this->fillTableWithValueFromFormJsni();
$this->saveJApplAndJApplAttFileJsni($job, $listJApplianceAttachedCV, $listJApplianceAttachedFile, $listDetailForm);
// End Sauvegarde
// ... rest of the code 发布于 2014-10-02 21:29:22
正如它所说的,您希望将一个字符串与一个数组连接起来。使用var_dump输出$listJApplianceAttachedCV的值。我真的不知道symfon1或2,我只在2中做了一些练习,但如果php说你想使用一个数组作为字符串,它一定是正确的,你应该在陷入绝望之前真正检查一下你的变量的值是什么。
发布于 2014-10-02 21:46:49
在将变量直接放入字符串之前,最好检查变量的类型。您似乎已经在用户会话中设置了一个数组。See more documentation about getAttribute method
如果希望数组为字符串,请使用“implode”
https://stackoverflow.com/questions/26161454
复制相似问题