RE: [PHPTAL] Empty loops

2009-06-18 Thread phptal
Hi Kornel,

> -Original Message-
> Sent: 18 June 2009 10:13
> 
> In PHPTAL empty array evaluates to false, so this works:
> 
> No titles found.  tal:condition="titles"> ...
> 
> 
> If you want an empty list item:
> 
>   
> No titles found
> 
>   title is missing
> 
>   

This empty list item is just what I wanted. It works just fine.

Many thanks (and also to Reza Sanaie for his suggestion),

Chris


___
PHPTAL mailing list
PHPTAL@lists.motion-twin.com
http://lists.motion-twin.com/mailman/listinfo/phptal


Re: [PHPTAL] Empty loops

2009-06-18 Thread Kornel Lesinski

On 17 Jun 2009, at 19:59,  wrote:

I find the following works well for me to provide a list of webpage  
titles

with hyperlinks

 
   
 title

is missing
   
 

What I would also like to do is provide an empty entry if there are no
webpage titles in the database. For example:

 
   
 No titles found.
   
 

I'm confident PHPTAL can do this, but there are so many options that  
look as

though they might do the trick I'm not sure where to start.

Can anyone advise me?


In PHPTAL empty array evaluates to false, so this works:

No titles found.

...


If you want an empty list item:

 
   No titles found
   
 title

is missing
   
 


--
regards, Kornel


___
PHPTAL mailing list
PHPTAL@lists.motion-twin.com
http://lists.motion-twin.com/mailman/listinfo/phptal


Re: [PHPTAL] Empty loops

2009-06-17 Thread Reza Sanaie
Just don't pass in the titles variable, and in TAL do a 
tal:condition="exists: titles" around your loop, and have another block 
with tal:condition="not: exists: titles" for your No titles found block.


php...@jakeman.plus.com wrote:

Hi,

I find the following works well for me to provide a list of webpage titles
with hyperlinks

  

  title
is missing

  

What I would also like to do is provide an empty entry if there are no
webpage titles in the database. For example:

  

  No titles found.

  

I'm confident PHPTAL can do this, but there are so many options that look as
though they might do the trick I'm not sure where to start.

Can anyone advise me?

Thanks, Chris


___
PHPTAL mailing list
PHPTAL@lists.motion-twin.com
http://lists.motion-twin.com/mailman/listinfo/phptal
  


___
PHPTAL mailing list
PHPTAL@lists.motion-twin.com
http://lists.motion-twin.com/mailman/listinfo/phptal


[PHPTAL] Empty loops

2009-06-17 Thread phptal
Hi,

I find the following works well for me to provide a list of webpage titles
with hyperlinks

  

  title
is missing

  

What I would also like to do is provide an empty entry if there are no
webpage titles in the database. For example:

  

  No titles found.

  

I'm confident PHPTAL can do this, but there are so many options that look as
though they might do the trick I'm not sure where to start.

Can anyone advise me?

Thanks, Chris


___
PHPTAL mailing list
PHPTAL@lists.motion-twin.com
http://lists.motion-twin.com/mailman/listinfo/phptal