empty()
Usage
empty(obj)
Description
Returns a boolean value that indicates whether the given object is null or empty.
Note
Before the Structr 2.1 release this method did not work on collections/arrays. If you are running an older version of Structr and want to determine if a collection is empty, use gt()
in combination with size()
for that.
Examples
${empty("")}
${empty("test")}
${empty(find("User"))}
${empty(find("NonExistentType"))}
results in
true
false
false (if at least one user exists)
true