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: 8 months 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 2 years ago)
- Default Branch: main
- Last Pushed: 2023-07-23T10:07:36.000Z (over 2 years ago)
- Last Synced: 2025-01-13T21:16:38.477Z (9 months ago)
- Language: PHP
- Size: 4.88 KB
- Stars: 12
- Watchers: 1
- Forks: 1
- 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