{"id":19571738,"url":"https://github.com/loadsys/cakephp-svg-icon","last_synced_at":"2026-05-13T08:03:38.957Z","repository":{"id":72034523,"uuid":"604792389","full_name":"loadsys/cakephp-svg-icon","owner":"loadsys","description":null,"archived":false,"fork":false,"pushed_at":"2024-02-11T15:35:02.000Z","size":16,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-02-09T11:04:51.432Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/loadsys.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2023-02-21T19:55:51.000Z","updated_at":"2023-02-25T13:40:26.000Z","dependencies_parsed_at":null,"dependency_job_id":"59454d52-b3e3-43f8-9733-6c7514d2aae6","html_url":"https://github.com/loadsys/cakephp-svg-icon","commit_stats":{"total_commits":3,"total_committers":1,"mean_commits":3.0,"dds":0.0,"last_synced_commit":"a0bf671219a73222e43dd5c3d8a95ae8eac1de0c"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loadsys%2Fcakephp-svg-icon","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loadsys%2Fcakephp-svg-icon/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loadsys%2Fcakephp-svg-icon/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loadsys%2Fcakephp-svg-icon/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/loadsys","download_url":"https://codeload.github.com/loadsys/cakephp-svg-icon/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240840036,"owners_count":19866164,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-11T06:19:53.814Z","updated_at":"2026-05-13T08:03:38.904Z","avatar_url":"https://github.com/loadsys.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SvgIcon plugin for CakePHP 5.x\n\n![Build Status](https://github.com/loadsys/cakephp-svg-icon/actions/workflows/ci.yml/badge.svg?branch=main)\n\nThis plugin offers an easy way to display SVG icons, with options to customize and/or cache them. It's packaged as a trait that can be used anywhere in your app, with a helper (using the trait) for convenience and caching.\n\n## Installation\n\nYou can install this plugin into your CakePHP application using [composer](https://getcomposer.org).\n\nThe recommended way to install composer packages is:\n\n```\ncomposer require loadsys/cakephp-svg-icon\n```\n\n## Versions\n\n* Tags `1.x` are for CakePHP v4.x.\n* Tags `2.x` are for CakePHP v5.x.\n\n## Configuration\n\nIcons should be added to `config/app_svg_icon.php` - see the example included in `config` directory for the expected format. Any SVG icon should work, such as [heroicons](https://heroicons.com) or [Bootstrap Icons](https://icons.getbootstrap.com).\n\nIcons will be cached using the `default` cache config. This can be changed by supplying a different cache config when loading the helper:\n\n``` php\n/*\n * src/View/AppView.php\n */\npublic function initialize(): void\n{\n    $this-\u003eloadHelper('SvgIcon.SvgIcon', [\n        'cacheConfig' =\u003e 'svg_icon',\n    ]);\n}\n```\n\nThis example would use the `svg_icon` cache config, which can be set in `config/app/php`:\n\n``` php\n/*\n * Optional configuration settings for the SvgIcon plugin cache\n */\n'svg_icon' =\u003e [\n    'className' =\u003e FileEngine::class,\n    'prefix' =\u003e 'svg_icon_',\n    'path' =\u003e CACHE . 'views' . DS,\n    'duration' =\u003e '+1 years',\n    'url' =\u003e env('CACHE_DEFAULT_URL', null),\n]\n```\n\n## Usage\n\nConfigured icons can be displayed by name - here's an example based on the names used in the sample `config/app_svg_icon.php`.\n\n``` php\n\u003c?= $this-\u003eSvgIcon-\u003eget('heroicon.home') ?\u003e\n\u003c?= $this-\u003eSvgIcon-\u003eget('bootstrap.bi-house') ?\u003e\n```\n\nTo change default icon attributes, options can be provided:\n\n``` php\n\u003c?= $this-\u003eSvgIcon-\u003eget('heroicon.home', [\n  'class' =\u003e 'text-gray-300 h-9 w-9',\n  'stroke-width' =\u003e '2',\n]) ?\u003e\n```\n\nNote that attribute overrides apply only to the `svg` tag and not it's child `path` tag.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Floadsys%2Fcakephp-svg-icon","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Floadsys%2Fcakephp-svg-icon","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Floadsys%2Fcakephp-svg-icon/lists"}