Re: PHP Error Reporting E_ALL

From: Date: Fri, 31 Oct 2003 16:58:54 +0000
Subject: Re: PHP Error Reporting E_ALL
References: 1 2  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-10484@lists.php.net to get a copy of this message
> what notices from the template do you wan't to retrieve if not the > ones about undefined variables? The notices force you to keep your code clean. Think about this: You fetch data out of a db and want to assign those values to your template-placeholder. What if this data does not exist? You could do the following: if ($bDataExists) { $oTemplate->assign("data0", $aData[0]); . . . $oTemplate->assign("data[n]", $aData[[n]]); } else if (!$bDataExists) { $oTemplate->assign("data0", ""); . . . $oTemplate->assign("data[n]", ""); } Since I'm a friend of the "keep-it-short"-way, this would blow up some of my files, and this is why I want to let smarty look for unset indexes. > why don't you just turn off E_NOTICES before you call fetch() or > display() and turn them on again after that? Nah, I don't like that, looks like an "ugly" workaround (don't take it personal.... ;) )

« previous php.smarty.general (#10484) next »