Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Re: [SMARTY] Find in a list in an IF structure
On Thu, Oct 28, 2004 at 12:22:55PM +0300, Markku Niskanen wrote:
> Hello, my fellow mates in pain, hurry and frustration,
>
> What would you recommend for a better solution for my
> small Smarty problem?
>
> I have a fairly sophisticated class system where I generate
> forms on the fly using complex sets of templates. I have several
> {IF} cases where I have used multiple or's like this:
>
> <td valign=
>   {if
>   $fieldtypes[idx] eq "textarea" or
>   $fieldtypes[idx] eq "radiogroup" or
>   $fieldtypes[idx] eq "someother"
>   }
>     "top"
>  {else}
>      "middle"
>  {/if}>
> {$fieldlabels[idx]}</td>
> <td>
>  ... field generation goes here
> </td>
> etc...
>
> The above, of course, produces the correct valign
> attrbute for the various field labels. What I would like to
> use is a functionality like this:
>
> {if in_the_array($ftypes[idx], 'textarea,radiogroup,someother')}
>
> {else}
>
> {/if}

just write a php-function in_the_array(). that one will called when
used in {if}.


> You see what I am looking for, I suppose. So is there an
> internal function that might perform the "in_the_array" and return
> either true or false to the "if" structure? NB: I am NOT referring to
> the PHP in_array() function above. The "field types" are internal
> names.
>
> Or is it just too few hours of sleep that prevent me from finding
> the solution in the manual?
>
> Markku
>
> --
> Smarty General Mailing List (http://smarty.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

Report this thread to moderator Post Follow-up to this message
Old Post
Messju Mohr
10-28-04 01:58 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

PHP Smarty Templates archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 05:24 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.