1
我在Session中保存表單數據,並嘗試使用會話數組保存到名爲Property的模型。請看下面的數組。我認爲它與Session數組有關,但我不確定。CakePHP使用會話保存模型
當我試圖挽救像這樣,它不保存:
$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')'或者什麼?我們可以看到更多的代碼嗎? – Nick
正如尼克說...你可以告訴我們的行保存之前,請設置$ propertyData數組從會議嗎? – Happy