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] Managing vars not assigned
--- Jordi Canals <jcanals@gmail.com> wrote:
> 1) [...snip...]
> Any other thing that I should consider to totally compliant with
> E_STRICT? (I don't need backwards compatibility as all my servers run
> PHP 5.0.2).

You may want to turn error reporting down to E_ALL when including the
Smarty class and then put it back to E_STRICT afterwards instead of
modifying the Smarty class directly. While Smarty is compatible with
PHP5, it is not fully compliant so using E_STRICT against it is not
appropriate, IMO.

> 2) Thats about the templates. I've seen on ones not made by me two
> ways to check is a template var is empty or not assigned: In some
> templates there is:
>
> {if $varname != ''}
>      do stuff
> {/if}
>
> while in other templates you can see:
>
> {if !empty($varname)}
>     do stuff
> {/if}
>
> Wich method is better? I prefer checking for empty($varname) (as
> normally are vars not being assigned by the script) but want to know
> if there is some better way to do it.

Either is fine; just keep-in-mind PHP's evaluations for $foo=0:
empty($foo) => true
$foo == ''  => true
$foo === '' => false

xo boots

> Thanks for any comments,
> Jordi.

Report this thread to moderator Post Follow-up to this message
Old Post
Boots
10-20-04 09:08 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 04:25 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.