mugasho / phpui
php ui 框架
dev-master
2017-11-20 22:38 UTC
This package is not auto-updated.
Last update: 2024-09-29 03:36:29 UTC
README
Phpui 是一个仅使用 php 的 UI 框架。
它能做什么
使用纯 php 编写代码,并动态生成 Html、JavaScript、Css 等
安装
composer require mugasho/phpui
它是如何工作的
创建一个新的 HTML 文档对象
$htmlDoc=new PhpUi\HtmlDocument('Hello',Lang::$english); $htmlDoc->addClass(Classes::$content); $htmlDoc->setMetaViewport('device-width',1.0,0,'minimal-ui'); $htmlDoc->setMetaDescription('PhpUi is a php only extensible web framework'); $htmlDoc->setMetaKeywords('php,ui,phpUI,web,framework'); $htmlDoc->setMetaAuthor('Script-floor'); //start printing element $htmlDoc->start(); //create the body $body=new PhpUi\UI(typeOf::$body); //add classes to $body $body->addClass(Classes::$containerFluid); $body->start(); //close the element with end method $body->end(); $htmlDoc->end();
下一步
添加其他元素,如按钮、列表等。例如,添加一个按钮
$button=new PhpUi\UI(typeOf::$button); $button->setText('hello'); $button->setId('btn1'); $button->start(); $button->end(); //create a div $div=new Php\UI(typeOf::$div); $div->setId('div1'); $div->start(); $div->end();
快乐编码