[TYPO3-ect] Copying data from the model to teh view....
R. van Twisk
typo3 at rvt.dds.nl
Wed Mar 7 14:03:22 CET 2007
Ernesto Baschny [cron IT] wrote:
> R. van Twisk wrote: on 04.03.2007 05:12:
>
>
>>> in your template
>>> <?php
>>> $model=$this->get('model');
>>> ?>
>>> hi <?= $model->get('name');?>
>>>
>>>
>
>
>> I don't use phpView, but instead I use smarty.
>> So basically I don't want to interact with the view (lib_object)
>> but I prefer to operate directly on the dataset.
>>
>> I don't think I can do this easily in smarty:
>>
>
> You can.
>
>
>> {section name=loop value=$model->get('dataSetArray')}
>> ....<how to get the row for each loop to show the data????>
>> {/section}
>>
>> Normally I would do this:
>>
>> {section name=loop value=$dataSetArray}
>> {$dataSetArray[loop].name}<br />
>> {$dataSetArray[loop].image}<br />
>> {$dataSetArray[loop].otherVar}<br />
>> {/section}
>>
>
> Just assign the value first to a var in your template:
>
> {assign var=dataSet value=$model->get('dataSetArray')}
>
> Then your later loop will work as you already have it.
>
> Works?
>
> Cheers,
> Ernesto
>
Hey Ernesto,
I will try this later today and let you know here,
as it looks.. and read the doc it should work fine indeed..
Gosh... why didn't I think of that......
Ries
More information about the TYPO3-team-extension-coordination
mailing list