Re: Flexy problem
| From: | daniel dot garcia at assertio dot es | Date: | Wed, 03 Sep 2003 10:04:00 +0000 |
| Subject: | Re: Flexy problem | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-7543@lists.php.net to get a copy of this message | ||
Hi,
I tried the new Flexy from CVS to see the long awaited support for
associative arrays ( thanks Allan !! ),
but now the previous templates are not working.
This template:
{if:partes[10]}<h1>{partes[10]}</h1>{end:}
{partes[43]:h}
Compiles to:
<?php if ($t->partes[0]) {?><h1><?php echo htmlspecialchars
($t->partes[0]);?></h1><?php }?>
<?php echo $t->partes[3];?>
Saludos cordiales / Kind regards,
-- Daniel García
==========================================
Daniel García - assertio sccl
Gran Vía Carles III 33-35, entlo. 2
08028 - Barcelona
Tel.: +34 93 409 7026
Fax: +34 93 491 1818
==========================================
|---------+---------------------------->
| | Alan Knowles |
| | <alan@akbkhome.co|
| | m> |
| | |
| | 03/09/2003 10:54 |
| | |
|---------+---------------------------->
>>---------------------------------------------------------------------------------------------------------------------------------------------|
|
|
| Para: Kjetil Wikestad <wikestad@stud.ntnu.no>
|
| cc: pear-general@lists.php.net
|
| Asunto: Re: [PEAR] Flexy problem
|
>>---------------------------------------------------------------------------------------------------------------------------------------------|
yeah - I got caught by that too. :) - fixed in cvs now..
Regards
Alan
Kjetil Wikestad wrote:
> Hi.
>
> I got the latest source from the CVS and tried to use associative
> arrays. It worked, sort of, but not in the way that I expected it will
> work combined with flexy:foreach.
>
> This is my compiled template:
>
> <?php if (is_array($t->tasklist)) foreach($t->tasklist as $task) {?><tr>
> <td align =center><?php echo
> htmlspecialchars($t->task['priority']);?></td>
> <td><?php echo htmlspecialchars($t->task['due']);?></td>
> <td><?php echo htmlspecialchars($t->task['title']);?></td>
> </tr><?php }?>
>
> But I expected it to be like this:
>
> <?php if (is_array($t->tasklist)) foreach($t->tasklist as $task) {?><tr>
> <td align =center><?php echo htmlspecialchars($task
['priority']);?></td>
> <td><?php echo htmlspecialchars($task['due']);?></td>
> <td><?php echo htmlspecialchars($task['title']);?></td>
> </tr><?php }?>
>
> --
> Kjetil W.
>
> Alan Knowles wrote:
>
>>
>> fixed in cvs.
>>
>> {array[0]}
>> {array[entry]}
>> {multi[array][0]}
>> {object[array].with[objects]}
>>
>> key values can be A-Za-z and _
>>
>>
>>
>> <?php echo htmlspecialchars($t->array[0]);?>
>> <?php echo htmlspecialchars($t->array['entry']);?>
>> <?php echo htmlspecialchars($t->multi['array'][0]);?>
>> <?php echo
>> htmlspecialchars($t->object['array']->with['objects']);?>
>>
>> Regards
>> Alan
>>
>>
>>
>> Mitchell Perilstein wrote:
>>
>>> You can, however, call methods. This means you could have a reset()
>>> method and a getNext() method for each array in your object, which
might
>>> be an alternative to [].
>>>
>>> On Sun, 2003-08-31 at 13:12, Andy Crain wrote:
>>>
>>>> I might be wrong on this, but to my knowledge you can't, sadly, output
>>>> associative arrays in Flexy templates, only numeric-indexed arrays.. I
>>>> suspect that's the problem.
>>>> Andy
>>>>
>>>>
>>>>> -----Original Message-----
>>>>> From: Kjetil Wikestad [mailto:wikestad@stud.ntnu.no]
>>>>> Sent: Saturday, August 30, 2003 2:20 PM
>>>>> To: pear-general@lists.php.net
>>>>> Subject: [PEAR] Flexy problem
>>>>>
>>>>> Hi!
>>>>>
>>>>> I just started using Flexy and I like it so far. But there is a small
>>>>> problem I can't overcome. This is my template:
>>>>>
>>>>> {foreach:tasklist,taskid,task}
>>>>> <a
>>>>> href="/tasks/view.task.php?{taskid}">{task[title]}</a><br>
>>>>> {end:}
>>>>>
>>>>> I thought this would produce a list of links with task titles, but it
>>>>> doesn't do that. Instead it produce "{task[title]}". How do I
>>>>> fix
>>>>
>>>>
>>>>
>>>> this?
>>>>
>>>>> --
>>>>> Kjetil W.
>>>>>
>>>>> --
>>>>> PEAR General Mailing List (http://pear.php.net/)
>>>>> To unsubscribe, visit:
>>>>> http://www.php.net/unsub.php
>>
>>
>>
>>
--
Can you help out?
Need Consulting Services or Know of a Job?
http://www.akbkhome.com
--
PEAR General Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php