161 / zf-octicons-view-helper
使用 Octicons 与 Zend\View:echo $this->octicon('mark-github')
0.1.2
2017-08-30 17:16 UTC
Requires
- php: ^7.0
- zendframework/zend-json: ^3.0 || ^2.6
- zendframework/zend-servicemanager: ^3.0
- zendframework/zend-view: ^2.6
Requires (Dev)
- phpunit/phpunit: ^6.0 || ^5.7
This package is auto-updated.
Last update: 2024-09-18 04:20:12 UTC
README
使用方法
<!-- view/application/your-page.phtml --> <button class="btn btn-primary"><?= $this->octicon('mark-github') ?> GitHub's icons</button>
/* octicons.css */ .octicon { display: inline-block; vertical-align: text-top; fill: currentColor; }
常见问题解答
选项
$this->octicon('mark-github', 1); // icon size: 100% $this->octicon('mark-github', 2); // icon size: 200% $this->octicon('mark-github', [ 'ratio' => 1, // icon size: 100% 'class' => 'octicon', // Attribute class="" ]);
安装
$ composer require 161/zf-octicons-view-helper
- 在您的
config/module.config.php
中添加模块Io161\Octicons
- 添加样式
octicons.css
更新 Octicons
$ composer octicons-update
需要 Yarn 或在 composer.json 文件中将 Yarn 替换为 NPM。
运行单元测试
$ composer test