robinn / uikit
一个支持多个CSS框架,用于开发通用网页界面的工具包。
1.1.1
2024-02-17 20:11 UTC
Requires
- php: >=8.2
- twig/twig: ^3.8
Requires (Dev)
- gajus/dindent: ^2.0
- phpstan/phpstan: ^1.10
- phpunit/phpunit: ^11.0
This package is auto-updated.
Last update: 2024-10-01 00:14:48 UTC
README
一个支持多个CSS框架,用于开发通用网页界面的工具包。
安装
composer require robinn/uikit
基本用法
简单使用echo打印所有内容。
ob_start(); echo 'HTML code'; echo alert('Default'); echo layout(ob_get_clean(), [ 'title' => 'Site title', ]);
也可以在模板中调用组件
$html = get_ui() ->addPath(__DIR__.'/templates') // Path to dir with custom templates ->render('page'); // page.twig in templates/ dir echo layout($html, [ 'title' => 'Site title', ]);
page.twig
HTML code
{{ alert('Default') }}
有多种语法可供选择,您可以根据需要选择。
注意:无需使用
layout()
,您也可以使用自己的逻辑。
需求
- PHP >= 8.2