mindfactory/cakephp-svgicons

用于 CakePHP 的 SVG 图标辅助插件

0.2.0 2024-05-09 10:21 UTC

This package is auto-updated.

Last update: 2024-09-11 12:14:28 UTC


README

Mindfactory/Svgicons
CakePHP 辅助工具,用于使用通过包管理器(如 npm)安装的 SVG 图标

快速设置

composer require mindfactory/cakephp-svgicons
bin/cake plugin load Mindfactory/Svgicons

src/View/appView.php 中添加辅助工具。

 $this->addHelper('Mindfactory/Svgicons.Icon', [
    'iconSets' => [
        'default' => [
            'svg' => '/path/to/{icon}.svg'],
    ],
]);

在视图中使用辅助工具

<?= $this-Icon->get('iconName') ?>

更多信息请参阅文档