SproutCMS

This is the code documentation for the SproutCMS project

function recordCounts()

Return the tags for a table, along with the number of records for each tag

Usage

array Tags::recordCounts ( string $table , int $limit );

Example

$tags = Tags::recordCounts('blog_posts', 50);
foreach ($tags as $tag => $count) {
    echo Enc::html($tag), ' (', $count, ')';
}

Arguments

  1. string $table
    Table to get counts for, e.g 'blog_posts'
  2. int $limit
    Maximum number of tags to return. Use 999999 for "unlimited".

Return value

  • array
    Keys are tag names, values are counts