websemantics/file-icons

PHP特定图标。Atom File-icons的移植版本,https://github.com/file-icons/atom

1.0.1 2017-03-26 21:35 UTC

This package is not auto-updated.

Last update: 2024-09-20 19:50:34 UTC


README

╭──────┬─╮                       ╭─────╮
│        │                       │     │
│      ╭─╯╭───╮╭───╮ ╭──────╮    ├─────┤╭──────╮╭──────╮╭────┬─╮╭──────╮
│      ╰─╮├───┤│   │ │  ──  │    │     ││   ╭──╯│   ╭╮ ││      ││  ────┤
│      ╭─╯│   ││   │ │      │    │     ││   ╰──╮│   ││ ││   ╭╮ ││      │
│      │  │   ││   │ │  ────┤    │     ││      ││   ╰╯ ││   ││ │├────  │
╰──────╯  ╰───╯╰───╯ ╰──────╯    ╰─────╯╰──────╯╰──────╯╰───╯╰─╯╰──────╯
╭─╮ ╭─╮ ┬─╮    ╭─╮ ┬ ┬ ╭─╮   ╭─╮ ╭─╮ ╭─╮ ┬   ┬ ╭─╮ ╭─╮ ╭┬╮ ┬ ╭─╮ ╭╮╭ ╭─╮
├┤  │ │ ├┬╯    ├─╯ ├─┤ ├─╯   ├─┤ ├─╯ ├─╯ │   │ │   ├─┤  │  │ │ │ │││ ╰─╮
┴   ╰─╯ ┴╰─    ┴   ┴ ┴ ┴     ┴ ┴ ┴   ┴   ┴─╯ ┴ ╰─╯ ┴ ┴  ┴  ┴ ╰─╯ ╯╰╯ ╰─╯

PHP特定图标。Atom File-icons的移植版本,https://github.com/file-icons/atom

Icon previews

安装

1- 使用Composer按以下方式安装,

composer require websemantics/file-icons

入门指南

创建FileIcons类的实例。

use Websemantics\FileIcons\FileIcons;

$icons = new FileIcons();

在html文档的头部包含css样式。这将生成一个指向包样式的link标签。

FileIcons::includeCss();

获取表示文件名的图标的类名,例如text-icon

$filename = 'src/index.php';
$class_name = $icons->getClass($filename);

您还可以获取关联图标的颜色类名。

$filename = 'README.md';
$class_name = $icons->getClassWithColor($filename);

使用类名生成html,例如

echo "<a><i class='$class_name'></i>$filename</a>";

查看实现细节 - Markdown Browser Plus

资源

支持

需要帮助或有疑问?请在StackOverflow上发帖。

请不要使用问题跟踪器进行支持/提问。

如果您觉得这个项目有用,请星标以表示支持或仅仅因为它是如此出色 :)

贡献

本项目接受以下形式的贡献:反馈、错误报告以及更好的是 - 提交请求。

许可

MIT许可 版权所有 (c) Web Semantics, Inc.