https://github.com/yassinedoghri/codeigniter-icons
A CodeIgniter4 library with convenient helper functions to render svg icons using https://github.com/yassinedoghri/php-icons.
https://github.com/yassinedoghri/codeigniter-icons
codeigniter-library codeigniter4 iconify icons svg-icons
Last synced: 6 months ago
JSON representation
A CodeIgniter4 library with convenient helper functions to render svg icons using https://github.com/yassinedoghri/php-icons.
- Host: GitHub
- URL: https://github.com/yassinedoghri/codeigniter-icons
- Owner: yassinedoghri
- License: mit
- Created: 2024-03-25T17:04:25.000Z (over 1 year ago)
- Default Branch: develop
- Last Pushed: 2024-10-20T16:07:49.000Z (12 months ago)
- Last Synced: 2025-04-11T23:52:46.529Z (6 months ago)
- Topics: codeigniter-library, codeigniter4, iconify, icons, svg-icons
- Language: PHP
- Homepage:
- Size: 207 KB
- Stars: 6
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
- Security: SECURITY.md
Awesome Lists containing this project
README
# CodeIgniter Icons 🔥 🙂
A [CodeIgniter4](https://codeigniter.com/) library with convenient helper
functions to render svg icons using
[php-icons](https://github.com/yassinedoghri/php-icons).[](https://packagist.org/packages/yassinedoghri/codeigniter-icons)
[](https://packagist.org/packages/yassinedoghri/codeigniter-icons)
[](https://packagist.org/packages/yassinedoghri/codeigniter-icons)
[](https://packagist.org/packages/yassinedoghri/codeigniter-icons)## 🚀 Getting started
### 0. Prerequisites
Usage of CodeIgniter Icons requires the following:
- A CodeIgniter 4.3.5+ based project
- Composer for package management
- PHP 8.1+### 1. Install via composer
```sh
composer require yassinedoghri/codeigniter-icons
```### 2. Setup
1. [init and configure PHPIcons](https://github.com/yassinedoghri/php-icons),
ie. create the PHPIcons config file.2. add icons helper to your `app/Config/Autoload.php` file:
```php
public $helpers = [/*...other helpers...*/, 'icons'];
```### 3. Usage
Use the `icon(string $iconKey, array $attributes)` helper function in your View
files to render svg icons:```php
= icon('material-symbols:bolt') ?>
//
//
//= icon('material-symbols:bolt', ['class' => 'text-2xl', "style" => "color: yellow;"]) ?>
// ...= icon('material-symbols:bolt')
->attr('class', 'text-2xl')
->attr('style', 'color: yellow;') ?>
// ...
```For more usage info, see
[php icons docs](https://github.com/yassinedoghri/php-icons).## ⚙️ Configuration
Checkout PHPIcons config reference to tweak things as you please.
```php
// new file - app/Config/Icons.php