list_count

Summary

Fetches the number of stored URLs.

Usage

fetch( 'url', 'list_count', [ hash( 'is_valid', is_valid ) ] )

Parameters

NameTypeDescriptionRequired
is_valid boolean Count invalid or valid URLs. No.

Returns

Integer (number of URLs).

Description

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:

  • Number of valid URLs
  • Number of invalid URLs
  • Total number of URLs (valid+invalid)

The examples below reveal a clear demonstration of this fetch function.

Examples

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

Contents

Reference

Database diagram
Template operators
Template functions
Data fetching
    Class
    Content
    Collaboration
    Layout
    Notification
    Package
    Section
    Shop
    URL
       list
       list_count
    User
Modules
XML tags


Created

06/02/2004
1:51:05 pm
by Balazs Halasy

Last updated

12/02/2004
10:47:28 am
by Balazs Halasy

Authors

Balazs Halasy
Bård Farstad



This page is part of the Exponential documentation. The documentation is available under the GNU Free Documentation License. All contributions will be released under the terms of this license.