Compare strings in templates

eq is function, not an operator. It is called with the form: eq <x> <y> (not <x> eq <y>).

You can fix your template by moving the operands from the the sides of eq to after it:

{{if eq . "login failed"}}
<span class="text-error">Incorrect username or password</span>
{{else if eq . "login success"}}
<span class="text-success">You have successfully logged in!</span>
{{end}}

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)