1 <?php
2 /**
3 * Cross - a micro PHP 5 framework
4 *
5 * @link http://www.crossphp.com
6 * @license MIT License
7 */
8
9 namespace Cross\Lib\Document;
10
11 /**
12 * 用PHP来描述HTML
13 *
14 * @author wonli <wonli@live.com>
15 * Class HTML
16 * @package Cross\Lib\Document
17 *
18 * <pre>
19 * example:
20 * echo HTML::div('im a div');
21 * echo HTML::a(array('@content'=>'crossphp', 'href'=>'http://www.crossphp.com'));
22 * echo HTML::div(array('@content' => 'im a div', 'style'=>'border:1px solid #dddddd;padding:20px;'),
23 * HTML::a(array('@content'=>'crossphp', 'href'=>'http://www.crossphp.com'))
24 * );
25 * echo HTML::form(array('method'=>'get'),
26 * HTML::div(
27 * HTML::label('User Name:', HTML::input(array('type'=>'text'))),
28 * HTML::label('Password :', HTML::input(array('type'=>'password'))),
29 * HTML::label(' ', HTML::input(array('type'=>'submit', 'value'=>'submit')))
30 * )
31 * );
32 * </pre>
33 */
34 class HTML
35 {
36 /**
37 * HTML处理类入口
38 *
39 * @param string $name
40 * @param mixed $arguments
41 * @return CallTree
42 */
43 static function __callStatic($name, $arguments)
44 {
45 $callTree = CallTree::getInstance();
46 $callTree->saveNode($name, $arguments);
47 return $callTree;
48 }
49 }
50