[cvs] [Wiki] changed: Doc/Dev/TemplatePackage
Wiki Guest
wikiguest at horde.org
Fri May 18 17:45:56 UTC 2007
guest [216.223.209.81] Fri, 18 May 2007 10:45:56 -0700
Modified page: http://wiki.horde.org/Doc/Dev/TemplatePackage
New Revision: 1.2
Change log: Fixed 'if' section to include the third param on set()
@@ -106,9 +106,11 @@
// with the checkUserAuth() function returning a true or false
// $is_auth = checkUserAuth();
// Set the 'if' variable into the template object.
-$template->set('is_auth', $is_auth);
+// **** Note that the third parameter is required to tell the template
engine that
+// the variable will be used in an 'if' test, otherwise the 'if' will
_always_ return 'true'.
+$template->set('is_auth', $is_auth, true);
// And we set up another variable for inclusion inside the if statement
$template->set('visitors', countvisits());
</code>
More information about the cvs
mailing list