【发布时间】:2026-01-30 21:10:02
【问题描述】:
我将表单数据保存在会话中,并尝试使用会话数组保存到名为 Property 的模型中。请看下面的数组。我认为它与 Session 数组有关,但我不确定。
当我尝试像这样保存时,它没有保存:
$this->Property->save($propertyData) where $propertyData is the property array.
sql_dump:
INSERT INTO `fra`.`properties` (`type`, `address`, `city`, `state`, `zip`, `price`, `bed_rooms`, `bath_rooms`, `lot_size_sq_ft`)
VALUES ('0', '2720 Acapulco way', 'modesto', 'ca', '95355', 310000, 4, 3, 6040)
会话数组是:
Array
(
[house_details] => Array
(
[form] => Array
(
[section] => house_details
)
[Property] => Array
(
[type] => 0
[address] => 2720 Acapulco way
[city] => modesto
[state] => ca
[zip] => 95355
[price] => 310000
[prop_year_build] => 2007
[prop_year_remodel] =>
[bed_rooms] => 4
[bath_rooms] => 3
[garage_spaces] => 3
[lot_size_sq_ft] => 6040
[house_size_sq_ft] => 3720
[stories] => 2
[condition_rating] => 8
)
【问题讨论】:
-
您使用的是
CakeSession::read('foo')还是什么?我们可以看到更多的代码吗? -
正如尼克所说...您能告诉我们保存之前设置会话中 $propertyData 数组的行吗?
标签: cakephp cakephp-2.0 session-variables