Adam 2009-01-30
Documentation » Loopl_each
Loads subnodes of current node (page) into current node context using given contraints. This function should be used in loop context and it is root of all subnode listings.
while(l_each('post', 10, g_arg('page', 1))) {
p('title', 'h1');
p('content', 'div);
}
bool l_each( [string $types = false, int $limit = 0, int $page = 1, int $options = false, string $search = false, string $sort = false, string $last = false, string $since = false] )
Parameters
- string $types Comma separated list of subnode types (FALSE for any)
- int $limit Maximum count of returned subnodes and page count (0 for unlimited)
- int $page Page number
- int $options Load options
- string $search Tag name or text to search inside of title or content (FALSE to abandon)
- string $sort Sort elements using specified field
- string $last Return last sub-subnodes of specified type of matched subnodes
- string $since Return only subnodes updated after specified date/time
Constants
- O_LIST_TAGS Lists tags of the items
- O_LIST_USER Lists users not the nodes
- O_LIST_NATURAL Lists in the natural order
- O_LIST_COUNT Counts subelements of the items
- O_LIST_LAST Lists last elements of the items
- O_LIST_NEXT Lists only children of current node
- O_LIST_FILES Lists files of the item
- O_SEARCH_TITLE Searches for inside the title
- O_SEARCH_CONTENT Searches for inside the content
- O_SEARCH_USER Searches for given username or id
- O_LIST_OWNER_TAGS Lists tags of the item owner
- O_LIST_POSITION Lists index of the items
- O_LIST_PARENTS Lists parents of the items
- O_LIST_RAW Lists all table elements as is (Useful for custom tables, i.e. 'country')
Returns
- bool TRUE if node was fetched into current context, FALSE if no (next) subnode was found (use this return value in while loop)
Last edited 2009-02-24 16:40:27
