0
people i have a table user who has a category field that is a field Boolean, at a certain point in my code I need that only if category is true I show an option in my menu, but do not know how to put no if, someone can help me, I’m trying like this but it’s not working:
<?php if((['usuario']['categoria']) == "true") {?>
<li id="users">
</li>
<?php }?>
Ta missing a variable ai
['usuario']['categoria']
can be an array ... if you want to compare a boolean you can also simplify.– rray
It would not be the same question as this https://answall.com/questions/200779/comond-blockingfeatures-depending on the user?
– Woss
I put a variable, but now I think if it’s not right because it’s working but even qnd category is false it ta considering true kk has something wrong
– André
Do
var_dump
of your variable and post here the result, please.– Woss
ta returning NULL ...
– André
So your variable is wrong. How are you setting it?
– Woss
This column is int or varchar on the seat?
– rray
then I created the variable.. ta so now if.... <? php if(($Register user['users']['category'])) {?>
– André
i set the variable so $this->set('Register user');
– André
i n am able to pass the value of the category field to the variable
– André