If a variable passed to view is 0 (int), the "echo" will be empty
See original GitHub issueIn my controller, I pass variables to my view like this:
return view.render('search', {
total: 0
})
From my view, if I do {{ total }}
it will be empty, but it works if I pass the variable like a string:
return view.render('search', {
total: '0'
})
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
php - if a variable in my while loop is empty, echo a 0 instead ...
In recent PHP versions you can use $row['Score'] ?: 0 etc.
Read more >empty() function in PHP to check variable for null, zero value etc
This function empty() will return True or False ( Boolean return ) based on status of the variable. if(empty($my_var)){echo " Variable is empty...
Read more >empty - Manual - PHP
A variable is considered empty if it does not exist or if its value equals false . empty() does not ... echo '$var...
Read more >How can I test if a variable is empty or contains only spaces?
First, note that the -z test is explicitly for: the length of string is zero. That is, a string containing only spaces should...
Read more >How to determine if a bash variable is empty? - Server Fault
A variable in bash (and any POSIX-compatible shell) can be in one of three ... is passed # 4. an empty array is...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It’s already fixed in the new version of Edge that should be out soon. Stay tunned!
@RomainLanz any updates on this? I noticed it doesn’t seem to be working in 1.1.4 either