承接 tim-oetting/lucide-php 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

tim-oetting/lucide-php

Composer 安装命令:

composer require tim-oetting/lucide-php

包简介

A modern PHP package for Lucide icons

README 文档

README

A modern PHP package for integrating Lucide icons into your PHP projects.

Installation

You can install the package via composer:

composer require tim-oetting/lucide-php

Requirements

  • PHP 8.0 or higher

Usage

Basic Usage

use TimOetting\LucidePhp\Lucide;

// Using the static icon method
echo Lucide::icon('github');

// Using magic method (alternative syntax)
echo Lucide::github();

Customizing Icons

The package provides a fluent interface to customize your icons:

// Add CSS classes
echo Lucide::github()->withClass('w-6 h-6 text-gray-500');

// Set custom size
echo Lucide::github()->withSize(24);

// Add custom attributes
echo Lucide::github()->withAttributes([
    'class' => 'icon',
    'stroke-width' => '1.5',
    'aria-hidden' => 'true'
]);

// Chain methods
echo Lucide::github()
    ->withSize(32)
    ->withClass('text-blue-500')
    ->withAttributes(['stroke-width' => '1.5']);

Error Handling

The package will throw an IconNotFoundException if the requested icon doesn't exist:

try {
    echo Lucide::nonexistentIcon();
} catch (TimOetting\LucidePhp\IconNotFoundException $e) {
    // Handle the error
}

How It Works

The package loads SVG icons from the icons directory and allows you to manipulate them with various attributes. All icons are rendered as inline SVG, making them easy to style with CSS.

Features

  • 🚀 Simple and intuitive API
  • ⚡️ Fluent interface for icon customization
  • 🎨 Full support for custom attributes
  • 🔒 Secure SVG rendering with proper HTML escaping
  • 💪 Type-safe with PHP 8.0 features
  • 🎯 Zero dependencies

License

The MIT License (MIT). Please see the License File for more information.

Credits

统计信息

  • 总下载量: 3
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-12-19

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固