I have a MongoDB collection which has some values set to false
. However, when I populate the table in my view these false
values don't get printed.
I was thinking about changing their value before passing the variable to the view by going through all the elements and simply substitute false
with a "-" sign (it's a pricing page).
Do you think this is the best approach to solve this problem? How would you do it? Do you have other suggestions to fix it?
Thanks!
If the problem is how a false
value is being displayed, that's an issue for the "view" part of "model-view-controller" (MVC).
So, for example, in your blade template, you can do something like this:
{{ $model->value ? "it's true" : "it's false" }}