35

osc_count_categories()

[php]osc_count_categories()[/php]

Gets the total of categories. If categories are not loaded, this function will load them.

Code osc_count_categories():

[php]

function osc_count_categories() {
if ( !View::newInstance()->_exists(‘categories’) ) {
View::newInstance()->_exportVariableToView(‘categories’, Category::newInstance()->toTree() );
}
return osc_priv_count_categories();
}

/**
*
* @return int
*/

[/php]