automagic 및 관련 모델 데이터에 문제가 있습니다. 저는 4 가지 모델을 가지고 있습니다 : Exercice, Ecriture, Ligne, Compte. Exercice hasmany Ecriture와 Ecriture hasmany Ligne와 Compte hasmany Ligne은 서로 다른 외래 키에 의해 두 가지 관계가 있습니다. 내 양식을 채우기 위해 automagic을 사용하고 싶습니다. (관련 모델 데이터가 포함 된 Automagic
$ this-> 서식 -> 입력 : 나는 단순히 사용하는 첫 번째 레벨에 액세스하려면 지금
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
)
)
)
)
: 그래서 $ this-> 데이터를 사용하여, 내가보기에이 배열을 제공 'Ecriture.0.enonce');
모든 것이 잘 작동합니다.
하지만 사용 seconde 수준에 액세스 할 수 없습니다 :
$ this-> 서식 -> 입력 ('Ecriture.0.Ligne.0.libelle');
왜 그렇습니까? 누군가 나를 도울 수 있습니까?
질문이 확실하지 않습니다. 무엇이 문제입니까? – Leo
죄송합니다. 질문은 실제로 목록 상자에있었습니다. 나는 그것을 지금 바꿨다. 제 질문은 두 번째 레벨에 상대적인 필드가 자동으로 채워지지 않는 이유입니다. – Vestrep