Generation error after customizing template

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
venkatesh
User
Posts: 43

Generation error after customizing template

Post by venkatesh »

I have added a piece of code in template file phpfn.php (v10). i.e.
<!--## If ew_Val(PROJ.GetV("IsLDAPEnabled")) { ##-->
// User LDAP Validate event
function LDAP_UserValidate(&$usr, &$pwd) {
//logic
}
<!--## } ##-->

and after when I generate the project file PHPMaker throws the following error
PHPMaker: Generate phpmkrfn page error
PHPMaker (ewExphpmkrfn):(0)


mobhar
User
Posts: 11747

Post by mobhar »

Use "if" (lower case) instead of "If":

<!--## if ew_Val(PROJ.GetV("IsLDAPEnabled")) { ##-->
// User LDAP Validate event
function LDAP_UserValidate(&$usr, &$pwd) {
//logic
}
<!--## } ##-->


danielc
User
Posts: 1601

Post by danielc »

mobhar wrote:
<!--## if ew_Val(PROJ.GetV("IsLDAPEnabled")) { ##-->

  • <!--## if (ew_Val(PROJ.GetV("IsLDAPEnabled"))) { ##--> // need to add bracket for (ew_Val(..)) for your boolean value

Webmaster
User
Posts: 9430

Post by Webmaster »

ew_Val returns the string "TRUE" or "FALSE". If you have defined the field "IsLDAPEnabled" in settings.xml as Boolean, you can simply use:

<!--## if (PROJ.GetV("IsLDAPEnabled")) { ##-->
...
<!--## } ##-->


Post Reply