Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/ramazancetinkaya/recursive-category
- Owner: ramazancetinkaya
- License: mit
- Created: 2023-07-23T09:14:55.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-07-23T10:07:36.000Z (over 1 year ago)
- Last Synced: 2023-07-23T10:52:42.402Z (over 1 year ago)
- Language: PHP
- Size: 4.88 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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