diff --git a/README.md b/README.md index 2787c76..fed85a5 100644 --- a/README.md +++ b/README.md @@ -13,30 +13,20 @@ Old: ``` -My function: +New: ``` ``` -you can use function ```tag()``` for make html `````` (tag is name of html tag) -and use ```tag_end()``` for close tag ,it like `````` +you can use function ```h_tag()``` for make html `````` (tag is name of html tag) +and use ```h_tag_end()``` for close tag ,it like `````` so name of tag that I have in my function is: -"div", -"html", -"body", -"head", -"table", -"th", -"tr", -"td", -"a", -"p", -"form", -"input" +Almost every tags but doctype (and not support in html5 ones) diff --git a/example.php b/example.php index 972321a..2617a4c 100644 --- a/example.php +++ b/example.php @@ -1,5 +1,5 @@ '); - table('border="1"'); + h_html(); + h_body(); + h_print('table
'); + h_table('border="1"'); foreach($A as $a) { - th(); - show($a); - th_end(); + h_th(); + h_print($a); + h_th_end(); } - tr(); + h_tr(); each_all('td',$data_1); - tr_end(); + h_tr_end(); - tr(); + h_tr(); each_all('td',$data_2); - tr_end(); + h_tr_end(); - table_end(); - body_end(); - html_end(); + h_table_end(); + h_body_end(); + h_html_end(); ?> diff --git a/html_function.php b/html_function.php new file mode 100644 index 0000000..975ef74 --- /dev/null +++ b/html_function.php @@ -0,0 +1,24 @@ +"; }'); + } + function t_stop($tag){ + eval('function h_'.$tag.'_end(){ echo ""; }'); + } + function h_print($context){ + echo $context; + } + + t_init($singleton, $tags); +?> diff --git a/my_function.php b/my_function.php deleted file mode 100644 index 80bca8c..0000000 --- a/my_function.php +++ /dev/null @@ -1,106 +0,0 @@ -'; - } - function div_end() - { - echo ''; - } - - function html($add="") - { - echo ''; - } - function html_end() - { - echo ''; - } - - function body($add="") - { - echo ''; - } - function body_end() - { - echo ''; - } - - function head($add="") - { - echo ''; - } - function head_end() - { - echo ''; - } - - function table($add="") - { - echo ''; - } - function table_end() - { - echo '
'; - } - - function th($add="") - { - echo ''; - } - function th_end() - { - echo ''; - } - - function tr($add="") - { - echo ''; - } - function tr_end() - { - echo ''; - } - - function td($add="") - { - echo ''; - } - function td_end() - { - echo ''; - } - - function a($add="") - { - echo ''; - } - function a_end() - { - echo ''; - } - - function p($add="") - { - echo '

'; - } - function p_end() - { - echo '

'; - } - - function form($add="") - { - echo '
'; - } - function form_end() - { - echo '
'; - } - -?>