我對automagic及相關型號數據有疑問。我有4個模型:Exercice,Ecriture,Ligne,Compte。 Exercice hasmany Ecriture和Ecriture hasmany Ligne和Compte hasmany Ligne有兩種不同的外鍵關係。我想用automagic填充我的表單。因此,使用$這 - >數據,我給這個數組的觀點:Automagic及相關型號數據
Array
(
[Exercice] => Array
(
[id] => 1
[theme] => marchandises
)
[Ecriture] => Array
(
[0] => Array
(
[id] => 1
[exercice_id] => 1
[numero] => 1
[enonce] => Quelle est la dincee?
[Ligne] => Array
(
[0] => Array
(
[id] => 1
[ecriture_id] => 1
[compte_debit_id] => 2
[compte_credit_id] => 1
[montant_debit] => 23
[montant_credit] => 23
[libelle] => Achat de marchandises
[student_id] => 1
[CompteDebit] => Array
(
[id] => 2
[nom] => achat marchandises
)
[CompteCredit] => Array
(
[id] => 1
[nom] => caisse
)
)
)
)
現在,如果我想獲得第一級我簡單地使用:
$這個 - >形式 - >輸入( 'Ecriture.0.enonce');
一切正常!
但是用我無法訪問級別Seconde系列:
$這個 - >形式 - >輸入( 'Ecriture.0.Ligne.0.libelle');
這是爲什麼?有人能幫助我嗎?
你的問題不清楚,問題是什麼? – Leo 2011-03-18 00:56:22
對不起,問題實際上是在列表框中。我現在改變了。我的問題是爲什麼相對於第二級的字段沒有自動填充? – Vestrep 2011-03-18 10:08:36