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] includes
{if $report_type ne ""}
{include file="reports.$report_type.inc.html"}
{/if}

pete M wrote:

> is there a more elegant way to code below..The variable companed is
> also tpart of the file name
>
> {if $report_type == 'general'}
>     {include file="reports.general.inc.html"}
>
> {elseif $report_type == 'ppm'}
>     {include file="reports.ppm.inc.html"}
>
> {elseif $report_type == 'finance'}
>     {include file="reports.finance.inc.html"}
>
> {elseif $report_type == 'testing'}
>     {include file="reports.testing.inc.html"}
> {/if}
>

Report this thread to moderator Post Follow-up to this message
Old Post
Monte Ohrt
09-02-04 09:01 PM


Re: [SMARTY] includes
--- Monte Ohrt <monte@ispi.net> wrote:
> {if strstr($report_type ne ""}
>    {include file="reports.$report_type.inc.html"}
> {/if}

Hmm. It seems to me that he wants to do two things: check $report_type
against a range and if it is valid, then include a report. I would
might do something like:

> {if strpos("general||ppm||finance||testing||", "`$report_type`||")}
>    {include file="reports.$report_type.inc.html"}
> {/if}

Still, it seems more reasonable that this can be handled in the PHP
controller.

xo boots

> pete M wrote: 
>

Report this thread to moderator Post Follow-up to this message
Old Post
Boots
09-03-04 08:58 AM


Re: [SMARTY] includes
On Thu, Sep 02, 2004 at 04:26:54PM -0700, boots wrote:
> --- Monte Ohrt <monte@ispi.net> wrote: 
>
> Hmm. It seems to me that he wants to do two things: check $report_type
> against a range and if it is valid, then include a report. I would
> might do something like:
> 
>
> Still, it seems more reasonable that this can be handled in the PHP
> controller.

i'd really do that in the php controller.

either sign a contract that you will always and ever have a resonable
value assinged to $report_type, or usr a default_template_handler_func
to provide a reasonable fallback if "reports.$report_type.inc.html"
doesn't exists.

> xo boots
> 
>
> --
> 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
09-03-04 08:58 AM


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:01 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.