ez.no / exponential / documentation / reference / data fetching / url / list_count
fetch( 'url', 'list_count', [ hash( 'is_valid', is_valid ) ] )
| Name | Type | Description | Required |
|---|---|---|---|
| is_valid | boolean | Count invalid or valid URLs. | No. |
Integer (number of URLs).
This function can be used to fetch the number of stored URLs. If the is_valid parameter is set to true, the function will return the number of valid URLs; if it is set to false, the number of invalid URLs will be returned. If the parameter is omitted, the function will return the total number of URLs. In other words, when using this operator it is possible to fetch three things:
The examples below reveal a clear demonstration of this fetch function.
Example 1
{let valid_urls=fetch( 'url', 'list_count', hash( 'is_valid', true() ) ) Number of valid URLs: {$valid_urls} {/let}
Displays the number of valid URLs.
Example 2
{let invalid_urls=fetch( 'url', 'list_count', hash( 'is_valid', false() ) ) Number of invalid URLs:{$invalid_urls} {/let}
Displays the number of invalid URLs.
Example 3
{let urls=fetch( 'url', 'list_count' )} Total number of URLs: {$urls} {/let}
Displays the total number of URLs (valid and invalid).
Comments