|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
mobiledotcom Smarty n00b
Joined: 07 Mar 2019 Posts: 1
|
Posted: Thu Mar 07, 2019 3:55 pm Post subject: If/Else Statement In Template Using in_array |
|
|
Hello,
In PHP I have an array that contains a lot of data and I need to create an If/Else statement in the template based on one specific line.
The array looks like this (I'm omitting the other 52 lines):
Code: |
$clientsdetails
[52 other lines I omitted]
twofaenabled => false
|
Inside the template, if twofaenabled => false I want to show specific content. If true, I don't want the content to show.
How can I accomplish this?
Thanks! |
|
Back to top |
|
AnrDaemon Administrator
Joined: 03 Dec 2012 Posts: 1785
|
Posted: Thu Mar 07, 2019 8:50 pm Post subject: |
|
|
You don't need in_array for that.
Just Code: | {if empty($data.twofaenabled)} … {/if} | is sufficient. |
|
Back to top |
|
AnrDaemon Administrator
Joined: 03 Dec 2012 Posts: 1785
|
Posted: Thu Mar 07, 2019 8:54 pm Post subject: |
|
|
Wondering twhat this have to do with Smarty Development. Moved. |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|