I create an array in PHP code like that:
foreach ($this->get("DB")->result as $ct){
$contentTexts[$ct["langCode"]][$ct["wordCode"]] = $ct["wordText"]; //$contentTexts is a two dimensional array
}
and assign a variables like that
$this->set("contentTexts",$contentTexts); // $contentTexts is an array described above
$this->set("lwMetaTitle",$content->lwMetaTitle);
In template file when i want to use like:
<F3:repeat group="{{@contentTexts} }" key="{{@langCode}}" value="{{@ctext}}" counter="{{@counter}}">
{{@ctext[@lwMetaTitle]}}
</F3:repeat>
it throws an error. when i change this row
{{@ctext[@lwMetaTitle]}}
to
{{var_dump(@ctext[@lwMetaTitle])}}
it describes the error like this:
Internal Server Error Undefined index: @lwMetaTitle
I think it can not reach @lwMetaTitle variable in a for loop. So how can I do this?
I know it isn't exactly an answer, but I would just avoid using F3's templating system in favor of handling views with straight-up PHP. I have found that to be much easier especially since F3's docs and support are terrible. Besides, why bother learning a new non-standard syntax when you already know PHP?
Aside from that, my only other thought is to try getting the framework variable outside of the loop and assigning it to a local variable, something like this:
$var = F3::get('var_name');
<F3:repeat .... >
<?= $var; ?>
</F3:repeat>