Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ramazancetinkaya/recursive-category

This library provides functionality to handle hierarchical categories and render them recursively.
https://github.com/ramazancetinkaya/recursive-category

Last synced: 1 day ago
JSON representation

This library provides functionality to handle hierarchical categories and render them recursively.

Awesome Lists containing this project

README

        

# Recursive Category Library
This library provides functionality to handle hierarchical categories and render them recursively.

## Usage

```php
// Usage example:
$recursiveCategory = new RecursiveCategory();

// Add root-level categories
$recursiveCategory->addRootCategory(1, 'Category A');
$recursiveCategory->addRootCategory(2, 'Category B');

// Add child categories
$recursiveCategory->addChildCategory(1, 3, 'Category A Child 1');
$recursiveCategory->addChildCategory(1, 4, 'Category A Child 2');
$recursiveCategory->addChildCategory(2, 5, 'Category B Child 1');

// Render the categories as HTML list
echo $recursiveCategory->render();
```

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

## Authors

- [Ramazan Çetinkaya](https://github.com/ramazancetinkaya)

## Copyright

Copyright © 2023 Ramazan Çetinkaya