Skip to the content
Documentation

list

No ratings yet

Summary

Fetches the URLs that are stored in the URL table.

Usage

fetch( 'url', 'list', hash( [ 'is_valid', is_valid, ]
                            [ 'offset',   offset,   ]
                            [ 'limit',    limit     ] ) )

Parameters

Name Type Description Required
is_valid boolean Instructs the system to only fetch valid or invalid URLs. No.
offset integer The offset to start at. No.
limit integer The number of URLs that should be fetched. No.

Returns

An array of ezurl objects or FALSE.

Description

This function fetches URLs from the URL table.The URL table stores addresses that have been input using the URL or the XML block datatype. Please refer to the "URL storage" section of the "Concepts and basics" chapter for more information about how the system handles URLs.

The "is_valid", "offset" and "limit" parameters are optional. While the "is_valid" parameter can be used to filter out only valid (TRUE) or invalid (FALSE) URLs, the "offset" and "limit" parameters can narrow down the result. If the "is_valid" parameter is omitted, both valid and invalid URLs will be fetched. The function returns an array of ezurl objects. If no URLs can be found, the function will return FALSE.

Examples

Example 1

{def $urls=fetch( 'url', 'list', hash( 'is_valid', true(),
                                       'offset',   0,
                                       'limit',    10 ) )}

{foreach $urls as $url}
    {$url.url} <br />
{/foreach}

Outputs the first ten valid URLs that are stored in the URL table.

Changed in Exponential 6.0.15

The parameters of fetch( 'url', 'list' ) as kernel/url/function_definition.php of Exponential 6.0.15 defines them (eZURLFunctionCollection::fetchList()):

Parameter Change
only_published Defined in 6.0.15 (type -, required: No., default false); this page did not list it.

Contributors

Comments

Add a comment

Comments are read by a moderator before they appear.