krishnapawar/php-html-builder 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

krishnapawar/php-html-builder

Composer 安装命令:

composer require krishnapawar/php-html-builder

包简介

PHP HTML Builder - A Lightweight Alternative to LaravelCollective/HTML and Spatie/Laravel-HTML With the release of Laravel 11, support for laravelcollective/html has been discontinued, leaving many developers searching for a modern, simple solution to generate HTML and form elements. PHP HTML Builde

README 文档

README

With the release of Laravel 11, support for laravelcollective/html has been discontinued, leaving many developers searching for a modern, simple solution to generate HTML and form elements. PHP HTML Builder is here to fill that gap — offering a streamlined, intuitive alternative compatible with Laravel 9, 10, and 11.

This package provides an easy-to-use, fluent API that replicates the functionality of laravelcollective/html and spatie/laravel-html, enabling developers to effortlessly create HTML components, forms, inputs, checkboxes, radio buttons, dropdowns, links, images, and more.

Built with simplicity and flexibility in mind, PHP HTML Builder is a lightweight, PHP-first solution for building and managing dynamic user interfaces in Laravel applications.

📌 Features

  • 🏗 Alternative to laravelcollective/html for Laravel 11+
  • ✨ Simple and clean syntax for generating HTML and form elements
  • 📝 Supports forms, inputs, selects, checkboxes, buttons, and modals
  • 🌍 Works in both Laravel and standalone PHP projects
  • 🎨 Fully customizable with attributes

🔧 Installation

composer require krishnapawar/php-html-builder

🚀 Usage Examples

1️⃣ Generating Basic HTML Elements

use KrishnaPawar\HtmlBuilder\Html;

// Link
echo Html::link("https://example.com", "Visit Website", ["target" => "_blank"]);

// Image
echo Html::image("logo.png", "Website Logo");

// Inline CSS
echo Html::style("body { background-color: #f4f4f4; }");

// Inline JavaScript
echo Html::script("console.log('Hello, World!');");

// External CSS
echo Html::stylesheet("https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css");

// External JavaScript
echo Html::scriptSrc("https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js");

2️⃣ Generating Forms and Inputs

use KrishnaPawar\HtmlBuilder\Form;

// Open Form
echo Form::open("submit.php", "POST");

// Input Fields
echo Form::input("name", "text", "", ["placeholder" => "Enter Name"]);
echo Form::input("email", "email", "", ["placeholder" => "Enter Email"]);

// Select Dropdown
echo Form::select("role", ["admin" => "Admin", "user" => "User"], "user");

// Checkbox
echo Form::checkbox("subscribe", "yes", true);

// Submit Button
echo Form::submit("Send");

// Close Form
echo Form::close();

3️⃣ Creating a Modal

use KrishnaPawar\HtmlBuilder\Form;

// Modal Example
echo Form::modal(
    "myModal",
    "My Modal Title",
    "<p>This is a simple modal body.</p>",
    "<button class='btn btn-primary'>Save Changes</button>"
);

Output HTML:

<div id='myModal' class='modal'>
    <div class='modal-dialog'>
        <div class='modal-content'>
            <div class='modal-header'>
                <h5 class='modal-title'>My Modal Title</h5>
                <button type='button' class='close' data-dismiss='modal'>&times;</button>
            </div>
            <div class='modal-body'>
                <p>This is a simple modal body.</p>
            </div>
            <div class='modal-footer'>
                <button class='btn btn-primary'>Save Changes</button>
            </div>
        </div>
    </div>
</div>

📜 License

This package is open-source and available under the MIT License.

🤝 Contributing

Feel free to submit issues, feature requests, or contribute to improving this package!

🏷 Tags

Laravel, HTML Builder, PHP Forms, HTML Generator, LaravelCollective Alternative, Web Development, PHP Package, kp, krishnapawar,krishna pawar,Alternative,

krishnapawar/php-html-builder 适用场景与选型建议

krishnapawar/php-html-builder 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 53 次下载、GitHub Stars 达 0, 最近一次更新时间为 2025 年 02 月 18 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 krishnapawar/php-html-builder 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 krishnapawar/php-html-builder 我们能提供哪些服务?
定制开发 / 二次开发

基于 krishnapawar/php-html-builder 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-02-18