我对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