Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

smarty syntax - isset

Tags:

isset

smarty

{if isset({$LANG.domainmoreinfo}){$LANG.domainmoreinfo}{/if}

This seems to be an incorrect syntax, can someone tell me what am I doing wrong?

Can't we apply a isset on "$LANG.domainmoreinfo" (thing :s) perhaps? (yes, I'm that newbie)

Update: This is a string (so I believe), if that's the case, then, I can't use isset and I should use something that verifies is length?

Thanks a lot,
MEM

like image 347
MEM Avatar asked Nov 23 '25 09:11

MEM


2 Answers

i think you don't need to use {} for variable in a condition,

{if isset($LANG.domainmoreinfo)}
   {$LANG.domainmoreinfo}
{/if}
like image 106
kinnou02 Avatar answered Nov 25 '25 03:11

kinnou02


Try this:

{if isset($LANG.domainmoreinfo)} {$LANG.domainmoreinfo} {/if}

I think there was an issue with your curly braces, not necessary within the isset() condition as @kinnou02 said because the statement is already being processed by smarty due to the curly brace right at the start of the if

like image 31
filip Avatar answered Nov 25 '25 04:11

filip



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!