ObjectHTML Framework 0.0.9.1 for PHP 发布.欢迎试用
测试代码:
1<?php
2 class Controller_Default extends FLEA_Controller_Action {
3 function actionindex(){
4 //TODO 默认首页文件
5// $tblArticle =& FLEA::getSingleton('Model_User');
6// $result = $tblArticle->findAll();
7//
8//
9// $group =& FLEA::getSingleton('Model_Group');
10// $result2 = $group->findAll();
11// dump($result);
12// dump($result2);
13// global $___fleaphp_loaded_time;
14// print 'Processed in ' . (number_format(getTimer(microtime())-getTimer($___fleaphp_loaded_time),5,'.',' ')*1000) . ' ms.';
15 $_loadstart_time = microtime();
16 require_once 'include/OHTML.php';
17 /* 测试部分 */
18 $html = new HTML(); //构造HTML开始
19 $script = new Script(); //构造js脚本,外链
20 $script->Src = 'jquery.js';
21 $script2 = new Script(); //构造内部js脚本
22 $script2->setHTML("function print1(){ alert('ok') }");
23 $link1 = new Link('main.css'); //联入css
24 $style1 = new Style(); //内部css
25 $style1->setHTML('*{font-size:12px;}');
26 $head = new Head('',$script.$script2.$link1.$style1); //构造Head,并添加以上几个节点
27
28 $a2 = new A('http://www.baidu.com','a1','','aa');
29 $a2->Style="color:red;font-size:12px;";
30 $a2->setHTML("张怡冰2");
31
32 $img = new Img('phpMyAdmin\themes\darkblue_orange\screen.png');
33
34 $text = new Text('input1','你好中译本');
35 $text->Style = "color:red;";
36 $text->RegisterEvent('onclick','print1();');
37 $text2 = new Text('input2','','','',TEXT_PASSWORD);
38 $text3 = new Text('input3','sdfsdfsdfasdf','','',TEXT_TEXTAREA);
39 $text3->ExpandProperty = 'rows="10" cols="40"';
40 $radio = new Radio('cc1','10','c1','',false);
41 $label = new Label('','男','','cc1');
42 $radio2 = new Radio('cc2','11','c1','',true);
43 $label2 = new Label('','女','','cc2');
44 $checkbox1 = new CheckBox('ch1','20','ch2','',true);
45 $checkbox2 = new CheckBox('ch2','22','ch2','',false);
46 $btn = new Button('btn1','你好中译本');
47 $btn->Style = "color:red;";
48 $btn2 = new Button('btn2','提交','',BUTTON_SUBMIT);
49 $form1 = new Form('post.php','post',$text.new Br().$text2.new Br().$text3.new Br().$radio.$label.$radio2.$label2.$checkbox1.$checkbox2.$btn.$btn2);
50
51 $div = new Div('a1','','',$a2.$form1.new Br());
52 $div->Style = "border:1px #ececec solid;padding:4px;";
53 $div->Title = "你好这个层里能看得到吗?";
54
55 $th1 = new Th('','编号');
56 $th2 = new Th('','姓名');
57 $th3 = new Th('','学号');
58 $th4 = new Th('','邮箱');
59 $th5 = new Th('','年龄');
60 $th6 = new Th('','其他');
61 $th7 = new Th('','操作');
62 $tr = new Tr('','',$th1.$th2.$th3.$th4.$th5.$th6.$th7);
63 $thead = new THead('',$tr);
64
65 $tbody = new TBody('');
66 for($i=0;$i<30;$i++){
67 $td1 = new Td('',$i+1);
68 $td2 = new Td('','陈嵩');
69 $td3 = new Td('','234234234235');
70 $td4 = new Td('','eicesoft@126.com');
71 $td5 = new Td('','23');
72 $td6 = new Td('','其他的信息');
73 $td7 = new Td('','添加 修改 删除');
74 $tr3 = new Tr('','',$td1.$td2.$td3.$td4.$td5.$td6.$td7);
75 $tbody->addChild($tr3);
76 }
77 $table = new Table('','','',$thead.$tbody);
78 $table->Border = 1;
79 $table->CellPadding = 2;
80 $table->CellSpacing = 2;
81 $table->Caption = '学生记录表';
82
83 $li1 = new LI();
84 $li1->setHTML("列表项1");
85 $li2 = new LI();
86 $li2->setHTML("列表项2");
87 $li3 = new LI();
88 $li3->setHTML("列表项3");
89 $li4 = new LI();
90 $li4->setHTML("列表项4");
91
92 $ul = new UL('','',$li1.$li2.$li3.$li4);
93 $ol = new OL('','',$li1.$li2.$li3.$li4);
94
95 $select = new Select('a1','','');
96 $option1= new Option('1','张怡冰');
97 $option2 = new Option('2','陈嵩');
98
99 $select->SelectValue = '2';
100 $select->Size = '12';
101 $select->addChild($option1);
102 $select->addChild($option2);
103 $body = new Body('',$div.$img.$table.$ul.$ol.$select);
104 $html->setHTML($head,$body);
105 echo $html;
106 $total = sprintf("%01.5f",microtime()-$_loadstart_time);
107 echo "<br />processed in {$total} second(s)";
108 }
109 }
110?>
OO的方法构造HTML代码.简约而不简单.呵呵
/Files/eicesoft/OHTML.rar
分享到:
相关推荐
资源来自pypi官网。 资源全名:pyetl_framework-0.0.48.tar.gz
资源来自pypi官网。 资源全名:pyscraper_framework-0.0.23.tar.gz
资源来自pypi官网。 资源全名:pyscraper_framework-0.0.19.tar.gz
资源来自pypi官网。 资源全名:angus-framework-0.0.13.tar.gz
资源来自pypi官网。 资源全名:b_aws_testing_framework-0.0.17.tar.gz
资源分类:Python库 所属语言:Python 资源全名:drf-react-template-framework-0.0.13.tar.gz 资源来源:官方 安装方法:https://lanzao.blog.csdn.net/article/details/101784059
资源来自pypi官网。 资源全名:robotframework-MarcinKoperski-0.0.23.tar.gz
资源来自pypi官网。 资源全名:robotframework-MarcinKoperski-0.0.16.tar.gz
资源来自pypi官网。 资源全名:b_aws_testing_framework-0.0.19-py3-none-any.whl
资源分类:Python库 所属语言:Python 资源全名:robotframework-kafkalibrary-py3-0.0.2.1.tar.gz 资源来源:官方 安装方法:https://lanzao.blog.csdn.net/article/details/101784059
CrystalDecisions.Enterprise.Framework.dll 9.7.0.588 CrystalDecisions.Enterprise.InfoStore.dll 9.7.0.588 CrystalDecisions.CrystalReports.Engine.dll 10.5.0.1943 CrystalDecisions.Data.AdoDotNetInterop...
TMS FNC Core 3.1.0.0.exe Abstract framework independent library for executing RESTful HTTP(S) requests Abstract framework independent library for executing RESTful HTTP(S) requests Navigate to ...
Spring Framework 4.x Reference Documentation 中文翻译 Chinese translation of the Spring Framework 4.x Reference Documentation ...
minidao-framework-.1.2.1.RELEASE.zipminidao-framework-.1.2.1.RELEASE.zipminidao-framework-.1.2.1.RELEASE.zipminidao-framework-.1.2.1.RELEASE.zipminidao-framework-.1.2.1.RELEASE.zipminidao-framework-....
DotNetBar是一组用于.NET Framework环境下的一组组件集,利用该组件集能够打造绚丽并且实用的应用程序界面,给开发人员提供极大的便利。
一步一步实现中后台管理平台模板-基于Vue-cli3+Ant-Design-Vue,参考博文:https://blog.csdn.net/ABAP_Brave/article/details/99623934
XP操作系统应安装Microsoft .NET Framework 2.0(或以上),nLite需要它的支持。将Nlite汉化直接解压到安装了Nlite软件的文件夹内即可。在打开Nlite时选择中文就将显示为中文了
一步一步实现中后台管理平台模板-基于Vue-cli3+Ant-Design-Vue,参考博文:https://blog.csdn.net/ABAP_Brave/article/details/102338689
EZIRIZ 公司出品的 .NET 程序集加密保护系统,IntelliLock 选择了 100% 托管的方式来应用授权和保护特性。IntelliLock 支持 .NET Framework 1.1, 2.0, 3.0, 3.5 和 4.0 版,可以为您的 .NET 程序集提供强有力的保护