|
10 | 10 | use Yiisoft\Html\Tag\A; |
11 | 11 | use Yiisoft\Html\Tag\Br; |
12 | 12 | use Yiisoft\Html\Tag\Button; |
| 13 | +use Yiisoft\Html\Tag\Caption; |
| 14 | +use Yiisoft\Html\Tag\Col; |
| 15 | +use Yiisoft\Html\Tag\Colgroup; |
13 | 16 | use Yiisoft\Html\Tag\CustomTag; |
14 | 17 | use Yiisoft\Html\Tag\Div; |
15 | 18 | use Yiisoft\Html\Tag\Img; |
|
28 | 31 | use Yiisoft\Html\Tag\Select; |
29 | 32 | use Yiisoft\Html\Tag\Span; |
30 | 33 | use Yiisoft\Html\Tag\Style; |
| 34 | +use Yiisoft\Html\Tag\Table; |
| 35 | +use Yiisoft\Html\Tag\Tbody; |
| 36 | +use Yiisoft\Html\Tag\Td; |
31 | 37 | use Yiisoft\Html\Tag\Textarea; |
| 38 | +use Yiisoft\Html\Tag\Tfoot; |
| 39 | +use Yiisoft\Html\Tag\Th; |
| 40 | +use Yiisoft\Html\Tag\Thead; |
| 41 | +use Yiisoft\Html\Tag\Tr; |
32 | 42 | use Yiisoft\Html\Tag\Ul; |
33 | 43 | use Yiisoft\Html\Widget\CheckboxList\CheckboxList; |
34 | 44 | use Yiisoft\Html\Widget\RadioList\RadioList; |
@@ -867,6 +877,137 @@ public static function li(string $content = ''): Li |
867 | 877 | return empty($content) ? $tag : $tag->content($content); |
868 | 878 | } |
869 | 879 |
|
| 880 | + /** |
| 881 | + * Generates a {@see Caption} tag. |
| 882 | + * |
| 883 | + * @param string $content Tag content. |
| 884 | + * @param array $attributes The tag attributes in terms of name-value pairs. |
| 885 | + */ |
| 886 | + public static function caption(string $content = '', array $attributes = []): Caption |
| 887 | + { |
| 888 | + $tag = Caption::tag(); |
| 889 | + if ($content !== '') { |
| 890 | + $tag = $tag->content($content); |
| 891 | + } |
| 892 | + if ($attributes !== []) { |
| 893 | + $tag = $tag->replaceAttributes($attributes); |
| 894 | + } |
| 895 | + return $tag; |
| 896 | + } |
| 897 | + |
| 898 | + /** |
| 899 | + * Generates a {@see Col} tag. |
| 900 | + * |
| 901 | + * @param array $attributes The tag attributes in terms of name-value pairs. |
| 902 | + */ |
| 903 | + public static function col(array $attributes = []): Col |
| 904 | + { |
| 905 | + $tag = Col::tag(); |
| 906 | + return $attributes === [] ? $tag : $tag->replaceAttributes($attributes); |
| 907 | + } |
| 908 | + |
| 909 | + /** |
| 910 | + * Generates a {@see Colgroup} tag. |
| 911 | + * |
| 912 | + * @param array $attributes The tag attributes in terms of name-value pairs. |
| 913 | + */ |
| 914 | + public static function colgroup(array $attributes = []): Colgroup |
| 915 | + { |
| 916 | + $tag = Colgroup::tag(); |
| 917 | + return $attributes === [] ? $tag : $tag->replaceAttributes($attributes); |
| 918 | + } |
| 919 | + |
| 920 | + /** |
| 921 | + * Generates a {@see Table} tag. |
| 922 | + * |
| 923 | + * @param array $attributes The tag attributes in terms of name-value pairs. |
| 924 | + */ |
| 925 | + public static function table(array $attributes = []): Table |
| 926 | + { |
| 927 | + $tag = Table::tag(); |
| 928 | + return $attributes === [] ? $tag : $tag->replaceAttributes($attributes); |
| 929 | + } |
| 930 | + |
| 931 | + /** |
| 932 | + * Generates a {@see Thead} tag. |
| 933 | + * |
| 934 | + * @param array $attributes The tag attributes in terms of name-value pairs. |
| 935 | + */ |
| 936 | + public static function thead(array $attributes = []): Thead |
| 937 | + { |
| 938 | + $tag = Thead::tag(); |
| 939 | + return $attributes === [] ? $tag : $tag->replaceAttributes($attributes); |
| 940 | + } |
| 941 | + |
| 942 | + /** |
| 943 | + * Generates a {@see Tbody} tag. |
| 944 | + * |
| 945 | + * @param array $attributes The tag attributes in terms of name-value pairs. |
| 946 | + */ |
| 947 | + public static function tbody(array $attributes = []): Tbody |
| 948 | + { |
| 949 | + $tag = Tbody::tag(); |
| 950 | + return $attributes === [] ? $tag : $tag->replaceAttributes($attributes); |
| 951 | + } |
| 952 | + |
| 953 | + /** |
| 954 | + * Generates a {@see Tfoot} tag. |
| 955 | + * |
| 956 | + * @param array $attributes The tag attributes in terms of name-value pairs. |
| 957 | + */ |
| 958 | + public static function tfoot(array $attributes = []): Tfoot |
| 959 | + { |
| 960 | + $tag = Tfoot::tag(); |
| 961 | + return $attributes === [] ? $tag : $tag->replaceAttributes($attributes); |
| 962 | + } |
| 963 | + |
| 964 | + /** |
| 965 | + * Generates a {@see Tr} tag. |
| 966 | + * |
| 967 | + * @param array $attributes The tag attributes in terms of name-value pairs. |
| 968 | + */ |
| 969 | + public static function tr(array $attributes = []): Tr |
| 970 | + { |
| 971 | + $tag = Tr::tag(); |
| 972 | + return $attributes === [] ? $tag : $tag->replaceAttributes($attributes); |
| 973 | + } |
| 974 | + |
| 975 | + /** |
| 976 | + * Generates a {@see Td} tag. |
| 977 | + * |
| 978 | + * @param string $content Tag content. |
| 979 | + * @param array $attributes The tag attributes in terms of name-value pairs. |
| 980 | + */ |
| 981 | + public static function td(string $content = '', array $attributes = []): Td |
| 982 | + { |
| 983 | + $tag = Td::tag(); |
| 984 | + if ($content !== '') { |
| 985 | + $tag = $tag->content($content); |
| 986 | + } |
| 987 | + if ($attributes !== []) { |
| 988 | + $tag = $tag->replaceAttributes($attributes); |
| 989 | + } |
| 990 | + return $tag; |
| 991 | + } |
| 992 | + |
| 993 | + /** |
| 994 | + * Generates a {@see Th} tag. |
| 995 | + * |
| 996 | + * @param string $content Tag content. |
| 997 | + * @param array $attributes The tag attributes in terms of name-value pairs. |
| 998 | + */ |
| 999 | + public static function th(string $content = '', array $attributes = []): Th |
| 1000 | + { |
| 1001 | + $tag = Th::tag(); |
| 1002 | + if ($content !== '') { |
| 1003 | + $tag = $tag->content($content); |
| 1004 | + } |
| 1005 | + if ($attributes !== []) { |
| 1006 | + $tag = $tag->replaceAttributes($attributes); |
| 1007 | + } |
| 1008 | + return $tag; |
| 1009 | + } |
| 1010 | + |
870 | 1011 | /** |
871 | 1012 | * Generates a {@see Br} tag. |
872 | 1013 | */ |
|
0 commit comments