keruyphp/keruy-bulma
最新稳定版本:v1.0.0
Composer 安装命令:
composer require keruyphp/keruy-bulma
包简介
Flexible fluent PHP DSL for Bulma.
README 文档
README
Simple fluent PHP DSL for applying Bulma classes to keruy-html elements.
Installation
composer require keruyphp/keruy-bulma
Minimal setup
<?php declare(strict_types=1); require __DIR__ . '/vendor/autoload.php'; use KeruyPHP\KeruyBulma\Bulma; use KeruyPHP\KeruyHtml\Html; use KeruyPHP\KeruyHtml\HtmlElement; HtmlElement::extend('bulma', fn(HtmlElement $el) => new Bulma($el)); echo Html::button('Save') ->bulma()->button()->isPrimary()->isRounded();
Main Bulma elements
Start with a normal keruy-html element, then call bulma().
Title
echo Html::h1('Dashboard') ->bulma()->title()->is_1();
Button
echo Html::button('Save') ->bulma()->button()->isPrimary()->isRounded();
Notification
echo Html::div('Profile updated') ->bulma()->notification()->isSuccess();
Columns
echo Html::div(function () { Html::div('Left column')->bulma()->column(); Html::div('Right column')->bulma()->column(); }));
Input
echo Html::input(['type' => 'text']) ->bulma()->input()->isRounded();
Tag
echo Html::span('New') ->bulma()->tag()->isInfo()->isRounded();
Helpers
Bulma helpers are available through helpers().
echo Html::span('Info text') ->bulma()->helpers()->textColor()->hasTextInfo();
Returning to HtmlElement
Bulma methods return helper objects. Call end() to get the original HtmlElement back.
echo Html::button('Open') ->bulma()->button()->isPrimary()->end() ->prop('type', 'button') ->class('custom-button');
Notes
keruy-bulmaworks on top ofkeruy-html.- You can still use normal
HtmlElementmethods likeclass(),prop(),attrs()andpretty(). - Many Bulma modifier methods are virtual and are converted from camelCase to kebab-case classes automatically.
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 8
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-3.0
- 更新时间: 2026-05-08