30

osc_category()

[php]osc_category()[/php]

Gets current category

Code osc_category():

[php]
function osc_category() {
if (View::newInstance()->_exists(‘subcategories’)) {
$category = View::newInstance()->_current(‘subcategories’);
} elseif (View::newInstance()->_exists(‘categories’)) {
$category = View::newInstance()->_current(‘categories’);
} elseif (View::newInstance()->_exists(‘category’)) {
$category = View::newInstance()->_get(‘category’);
} else {
$category = null;
}
return($category);
}

/**
* @return array
*/
[/php]