Create a category

You can create a new category by calling the add method of the category controller:

$category_details = [
    'title' => 'category title'
$result = Koowa::getObject('com://site/docman.controller.category')

Fetch categories

For fetching categories, we set permission values for the current user, limit the results to 50 categories, and call the browse event.

// Get the controller
$controller = Koowa::getObject('com://site/docman.controller.category');
$user       = Koowa::getObject('user');
// Fetch all categories
$categories = $controller
    ->access($user->getRoles()) // Permissions
    ->limit(50)   // Limiting to 50 categories
    ->offset(0)   // You can set this to 50 in the next call to paginate results
foreach ($categories as $category){