Derek Jones | 8ede1a2 | 2011-10-05 13:34:52 -0500 | [diff] [blame] | 1 | ########### |
| 2 | HTML Helper |
| 3 | ########### |
| 4 | |
| 5 | The HTML Helper file contains functions that assist in working with |
| 6 | HTML. |
| 7 | |
| 8 | .. contents:: Page Contents |
| 9 | |
| 10 | Loading this Helper |
| 11 | =================== |
| 12 | |
| 13 | This helper is loaded using the following code:: |
| 14 | |
| 15 | $this->load->helper('html'); |
| 16 | |
| 17 | The following functions are available: |
| 18 | |
| 19 | br() |
| 20 | ==== |
| 21 | |
Derek Jones | b8c283a | 2013-07-19 16:02:53 -0700 | [diff] [blame^] | 22 | .. function:: br($count = 1) |
Andrey Andreev | 53b8ef5 | 2012-11-08 21:38:53 +0200 | [diff] [blame] | 23 | |
| 24 | :param int $count: Number of times to repeat the tag |
| 25 | :returns: string |
| 26 | |
Derek Jones | 8ede1a2 | 2011-10-05 13:34:52 -0500 | [diff] [blame] | 27 | Generates line break tags (<br />) based on the number you submit. |
| 28 | Example:: |
| 29 | |
| 30 | echo br(3); |
| 31 | |
| 32 | The above would produce: <br /><br /><br /> |
| 33 | |
| 34 | heading() |
| 35 | ========= |
| 36 | |
Derek Jones | b8c283a | 2013-07-19 16:02:53 -0700 | [diff] [blame^] | 37 | .. function:: heading($data = '', $h = '1', $attributes = '') |
Andrey Andreev | 53b8ef5 | 2012-11-08 21:38:53 +0200 | [diff] [blame] | 38 | |
| 39 | :param string $data: Content |
| 40 | :param string $h: Heading level |
| 41 | :param array $attributes: HTML attributes |
| 42 | :returns: string |
| 43 | |
| 44 | Lets you create HTML heading tags. The first parameter will contain the |
Derek Jones | 8ede1a2 | 2011-10-05 13:34:52 -0500 | [diff] [blame] | 45 | data, the second the size of the heading. Example:: |
| 46 | |
| 47 | echo heading('Welcome!', 3); |
| 48 | |
| 49 | The above would produce: <h3>Welcome!</h3> |
| 50 | |
| 51 | Additionally, in order to add attributes to the heading tag such as HTML |
Andrey Andreev | 53b8ef5 | 2012-11-08 21:38:53 +0200 | [diff] [blame] | 52 | classes, ids or inline styles, a third parameter is available:: |
Derek Jones | 8ede1a2 | 2011-10-05 13:34:52 -0500 | [diff] [blame] | 53 | |
| 54 | echo heading('Welcome!', 3, 'class="pink"') |
| 55 | |
| 56 | The above code produces: <h3 class="pink">Welcome!<<h3> |
| 57 | |
| 58 | img() |
| 59 | ===== |
| 60 | |
Derek Jones | b8c283a | 2013-07-19 16:02:53 -0700 | [diff] [blame^] | 61 | .. function:: img($src = '', $index_page = FALSE, $attributes = '') |
Derek Jones | 8ede1a2 | 2011-10-05 13:34:52 -0500 | [diff] [blame] | 62 | |
Andrey Andreev | 53b8ef5 | 2012-11-08 21:38:53 +0200 | [diff] [blame] | 63 | :param string $src: Image source data |
| 64 | :param bool $index_page: Whether to treat $src as a routed URI string |
| 65 | :param array $attributes: HTML attributes |
| 66 | :returns: string |
| 67 | |
| 68 | Lets you create HTML <img /> tags. The first parameter contains the |
| 69 | image source. Example:: |
Derek Jones | 8ede1a2 | 2011-10-05 13:34:52 -0500 | [diff] [blame] | 70 | |
| 71 | echo img('images/picture.jpg'); // gives <img src="http://site.com/images/picture.jpg" /> |
| 72 | |
| 73 | There is an optional second parameter that is a TRUE/FALSE value that |
Andrey Andreev | 53b8ef5 | 2012-11-08 21:38:53 +0200 | [diff] [blame] | 74 | specifics if the *src* should have the page specified by |
| 75 | ``$config['index_page']`` added to the address it creates. |
| 76 | Presumably, this would be if you were using a media controller:: |
Derek Jones | 8ede1a2 | 2011-10-05 13:34:52 -0500 | [diff] [blame] | 77 | |
| 78 | echo img('images/picture.jpg', TRUE); // gives <img src="http://site.com/index.php/images/picture.jpg" alt="" /> |
| 79 | |
| 80 | |
Andrey Andreev | 53b8ef5 | 2012-11-08 21:38:53 +0200 | [diff] [blame] | 81 | Additionally, an associative array can be passed to the ``img()`` function |
| 82 | for complete control over all attributes and values. If an *alt* attribute |
Derek Jones | 8ede1a2 | 2011-10-05 13:34:52 -0500 | [diff] [blame] | 83 | is not provided, CodeIgniter will generate an empty string. |
| 84 | |
Andrey Andreev | 53b8ef5 | 2012-11-08 21:38:53 +0200 | [diff] [blame] | 85 | Example:: |
Derek Jones | 8ede1a2 | 2011-10-05 13:34:52 -0500 | [diff] [blame] | 86 | |
| 87 | $image_properties = array( |
| 88 | 'src' => 'images/picture.jpg', |
| 89 | 'alt' => 'Me, demonstrating how to eat 4 slices of pizza at one time', |
| 90 | 'class' => 'post_images', |
| 91 | 'width' => '200', |
| 92 | 'height'=> '200', |
| 93 | 'title' => 'That was quite a night', |
| 94 | 'rel' => 'lightbox' |
| 95 | ); |
| 96 | |
Andrey Andreev | 53b8ef5 | 2012-11-08 21:38:53 +0200 | [diff] [blame] | 97 | img($image_properties); |
| 98 | // <img src="http://site.com/index.php/images/picture.jpg" alt="Me, demonstrating how to eat 4 slices of pizza at one time" class="post_images" width="200" height="200" title="That was quite a night" rel="lightbox" /> |
Derek Jones | 8ede1a2 | 2011-10-05 13:34:52 -0500 | [diff] [blame] | 99 | |
| 100 | |
| 101 | link_tag() |
Andrey Andreev | 53b8ef5 | 2012-11-08 21:38:53 +0200 | [diff] [blame] | 102 | ========== |
| 103 | |
Derek Jones | b8c283a | 2013-07-19 16:02:53 -0700 | [diff] [blame^] | 104 | .. function:: ling_tag($href = '', $rel = 'stylesheet', $type = 'text/css', $title = '', $media = '', $index_page = FALSE) |
Andrey Andreev | 53b8ef5 | 2012-11-08 21:38:53 +0200 | [diff] [blame] | 105 | |
| 106 | :param string $href: What are we linking to |
| 107 | :param string $rel: Relation type |
| 108 | :param string $type: Type of the related document |
| 109 | :param string $title: Link title |
| 110 | :param string $media: Media type |
| 111 | :param bool $index_page: Whether to treat $src as a routed URI string |
| 112 | :returns: string |
Derek Jones | 8ede1a2 | 2011-10-05 13:34:52 -0500 | [diff] [blame] | 113 | |
| 114 | Lets you create HTML <link /> tags. This is useful for stylesheet links, |
Andrey Andreev | 53b8ef5 | 2012-11-08 21:38:53 +0200 | [diff] [blame] | 115 | as well as other links. The parameters are *href*, with optional *rel*, |
| 116 | *type*, *title*, *media* and *index_page*. |
Derek Jones | 8ede1a2 | 2011-10-05 13:34:52 -0500 | [diff] [blame] | 117 | |
Andrey Andreev | 53b8ef5 | 2012-11-08 21:38:53 +0200 | [diff] [blame] | 118 | *index_page* is a boolean value that specifies if the *href* should have |
| 119 | the page specified by ``$config['index_page']`` added to the address it creates. |
Derek Jones | 8ede1a2 | 2011-10-05 13:34:52 -0500 | [diff] [blame] | 120 | |
Andrey Andreev | 53b8ef5 | 2012-11-08 21:38:53 +0200 | [diff] [blame] | 121 | Example:: |
| 122 | |
| 123 | echo link_tag('css/mystyles.css'); |
| 124 | // gives <link href="http://site.com/css/mystyles.css" rel="stylesheet" type="text/css" /> |
Derek Jones | 8ede1a2 | 2011-10-05 13:34:52 -0500 | [diff] [blame] | 125 | |
| 126 | |
Andrey Andreev | 53b8ef5 | 2012-11-08 21:38:53 +0200 | [diff] [blame] | 127 | Further examples:: |
Derek Jones | 8ede1a2 | 2011-10-05 13:34:52 -0500 | [diff] [blame] | 128 | |
Andrey Andreev | 53b8ef5 | 2012-11-08 21:38:53 +0200 | [diff] [blame] | 129 | echo link_tag('favicon.ico', 'shortcut icon', 'image/ico'); |
| 130 | // <link href="http://site.com/favicon.ico" rel="shortcut icon" type="image/ico" /> |
Derek Jones | 8ede1a2 | 2011-10-05 13:34:52 -0500 | [diff] [blame] | 131 | |
Andrey Andreev | 53b8ef5 | 2012-11-08 21:38:53 +0200 | [diff] [blame] | 132 | echo link_tag('feed', 'alternate', 'application/rss+xml', 'My RSS Feed'); |
| 133 | // <link href="http://site.com/feed" rel="alternate" type="application/rss+xml" title="My RSS Feed" /> |
Derek Jones | 8ede1a2 | 2011-10-05 13:34:52 -0500 | [diff] [blame] | 134 | |
Andrey Andreev | 53b8ef5 | 2012-11-08 21:38:53 +0200 | [diff] [blame] | 135 | Additionally, an associative array can be passed to the ``link()`` function |
| 136 | for complete control over all attributes and values:: |
Derek Jones | 8ede1a2 | 2011-10-05 13:34:52 -0500 | [diff] [blame] | 137 | |
| 138 | $link = array( |
Andrey Andreev | 53b8ef5 | 2012-11-08 21:38:53 +0200 | [diff] [blame] | 139 | 'href' => 'css/printer.css', |
| 140 | 'rel' => 'stylesheet', |
| 141 | 'type' => 'text/css', |
| 142 | 'media' => 'print' |
Derek Jones | 8ede1a2 | 2011-10-05 13:34:52 -0500 | [diff] [blame] | 143 | ); |
| 144 | |
Andrey Andreev | 53b8ef5 | 2012-11-08 21:38:53 +0200 | [diff] [blame] | 145 | echo link_tag($link); |
| 146 | // <link href="http://site.com/css/printer.css" rel="stylesheet" type="text/css" media="print" /> |
Derek Jones | 8ede1a2 | 2011-10-05 13:34:52 -0500 | [diff] [blame] | 147 | |
| 148 | nbs() |
| 149 | ===== |
| 150 | |
Derek Jones | b8c283a | 2013-07-19 16:02:53 -0700 | [diff] [blame^] | 151 | .. function:: nbs($num = 1) |
Derek Jones | 8ede1a2 | 2011-10-05 13:34:52 -0500 | [diff] [blame] | 152 | |
Andrey Andreev | 53b8ef5 | 2012-11-08 21:38:53 +0200 | [diff] [blame] | 153 | :param int $num: Number of space entities to produce |
| 154 | :returns: string |
| 155 | |
| 156 | Generates non-breaking spaces ( ) based on the number you submit. |
| 157 | Example:: |
Derek Jones | 8ede1a2 | 2011-10-05 13:34:52 -0500 | [diff] [blame] | 158 | |
| 159 | echo nbs(3); |
| 160 | |
Andrey Andreev | 53b8ef5 | 2012-11-08 21:38:53 +0200 | [diff] [blame] | 161 | The above would produce:: |
Derek Jones | 8ede1a2 | 2011-10-05 13:34:52 -0500 | [diff] [blame] | 162 | |
| 163 | |
| 164 | |
Andrey Andreev | 53b8ef5 | 2012-11-08 21:38:53 +0200 | [diff] [blame] | 165 | ul() and ol() |
Derek Jones | 8ede1a2 | 2011-10-05 13:34:52 -0500 | [diff] [blame] | 166 | ============= |
| 167 | |
Derek Jones | b8c283a | 2013-07-19 16:02:53 -0700 | [diff] [blame^] | 168 | .. function:: ul($list, $attributes = '') |
Andrey Andreev | 53b8ef5 | 2012-11-08 21:38:53 +0200 | [diff] [blame] | 169 | |
| 170 | :param array $list: List entries |
| 171 | :param array $attributes: HTML attributes |
| 172 | :returns: string |
| 173 | |
Derek Jones | 8ede1a2 | 2011-10-05 13:34:52 -0500 | [diff] [blame] | 174 | Permits you to generate ordered or unordered HTML lists from simple or |
Andrey Andreev | 53b8ef5 | 2012-11-08 21:38:53 +0200 | [diff] [blame] | 175 | multi-dimensional arrays. Example:: |
Derek Jones | 8ede1a2 | 2011-10-05 13:34:52 -0500 | [diff] [blame] | 176 | |
Andrey Andreev | 53b8ef5 | 2012-11-08 21:38:53 +0200 | [diff] [blame] | 177 | $list = array( |
| 178 | 'red', |
| 179 | 'blue', |
| 180 | 'green', |
| 181 | 'yellow' |
Derek Jones | 8ede1a2 | 2011-10-05 13:34:52 -0500 | [diff] [blame] | 182 | ); |
| 183 | |
Andrey Andreev | 53b8ef5 | 2012-11-08 21:38:53 +0200 | [diff] [blame] | 184 | $attributes = array( |
| 185 | 'class' => 'boldlist', |
| 186 | 'id' => 'mylist' |
Derek Jones | 8ede1a2 | 2011-10-05 13:34:52 -0500 | [diff] [blame] | 187 | ); |
| 188 | |
| 189 | echo ul($list, $attributes); |
| 190 | |
Andrey Andreev | 53b8ef5 | 2012-11-08 21:38:53 +0200 | [diff] [blame] | 191 | The above code will produce this:: |
Derek Jones | 8ede1a2 | 2011-10-05 13:34:52 -0500 | [diff] [blame] | 192 | |
Andrey Andreev | 53b8ef5 | 2012-11-08 21:38:53 +0200 | [diff] [blame] | 193 | <ul class="boldlist" id="mylist"> |
| 194 | <li>red</li> |
| 195 | <li>blue</li> |
| 196 | <li>green</li> |
Derek Jones | 8ede1a2 | 2011-10-05 13:34:52 -0500 | [diff] [blame] | 197 | <li>yellow</li> |
| 198 | </ul> |
| 199 | |
Andrey Andreev | 53b8ef5 | 2012-11-08 21:38:53 +0200 | [diff] [blame] | 200 | Here is a more complex example, using a multi-dimensional array:: |
Derek Jones | 8ede1a2 | 2011-10-05 13:34:52 -0500 | [diff] [blame] | 201 | |
Andrey Andreev | 53b8ef5 | 2012-11-08 21:38:53 +0200 | [diff] [blame] | 202 | $attributes = array( |
| 203 | 'class' => 'boldlist', |
| 204 | 'id' => 'mylist' |
Derek Jones | 8ede1a2 | 2011-10-05 13:34:52 -0500 | [diff] [blame] | 205 | ); |
| 206 | |
Andrey Andreev | 53b8ef5 | 2012-11-08 21:38:53 +0200 | [diff] [blame] | 207 | $list = array( |
| 208 | 'colors' => array( |
| 209 | 'red', |
| 210 | 'blue', |
| 211 | 'green' |
Derek Jones | 8ede1a2 | 2011-10-05 13:34:52 -0500 | [diff] [blame] | 212 | ), |
Andrey Andreev | 53b8ef5 | 2012-11-08 21:38:53 +0200 | [diff] [blame] | 213 | 'shapes' => array( |
| 214 | 'round', |
| 215 | 'square', |
| 216 | 'circles' => array( |
Derek Jones | 8ede1a2 | 2011-10-05 13:34:52 -0500 | [diff] [blame] | 217 | 'ellipse', |
| 218 | 'oval', |
| 219 | 'sphere' |
Andrey Andreev | 53b8ef5 | 2012-11-08 21:38:53 +0200 | [diff] [blame] | 220 | ) |
| 221 | ), |
| 222 | 'moods' => array( |
| 223 | 'happy', |
| 224 | 'upset' => array( |
Derek Jones | 8ede1a2 | 2011-10-05 13:34:52 -0500 | [diff] [blame] | 225 | 'defeated' => array( |
Andrey Andreev | 53b8ef5 | 2012-11-08 21:38:53 +0200 | [diff] [blame] | 226 | 'dejected', |
Derek Jones | 8ede1a2 | 2011-10-05 13:34:52 -0500 | [diff] [blame] | 227 | 'disheartened', |
| 228 | 'depressed' |
| 229 | ), |
| 230 | 'annoyed', |
| 231 | 'cross', |
| 232 | 'angry' |
| 233 | ) |
| 234 | ) |
| 235 | ); |
| 236 | |
| 237 | echo ul($list, $attributes); |
| 238 | |
Andrey Andreev | 53b8ef5 | 2012-11-08 21:38:53 +0200 | [diff] [blame] | 239 | The above code will produce this:: |
Derek Jones | 8ede1a2 | 2011-10-05 13:34:52 -0500 | [diff] [blame] | 240 | |
Andrey Andreev | 53b8ef5 | 2012-11-08 21:38:53 +0200 | [diff] [blame] | 241 | <ul class="boldlist" id="mylist"> |
| 242 | <li>colors |
| 243 | <ul> |
| 244 | <li>red</li> |
| 245 | <li>blue</li> |
| 246 | <li>green</li> |
| 247 | </ul> |
| 248 | </li> |
| 249 | <li>shapes |
| 250 | <ul> |
| 251 | <li>round</li> |
| 252 | <li>suare</li> |
| 253 | <li>circles |
| 254 | <ul> |
| 255 | <li>elipse</li> |
| 256 | <li>oval</li> |
| 257 | <li>sphere</li> |
| 258 | </ul> |
| 259 | </li> |
| 260 | </ul> |
| 261 | </li> |
| 262 | <li>moods |
| 263 | <ul> |
| 264 | <li>happy</li> |
| 265 | <li>upset |
| 266 | <ul> |
| 267 | <li>defeated |
| 268 | <ul> |
Derek Jones | 8ede1a2 | 2011-10-05 13:34:52 -0500 | [diff] [blame] | 269 | <li>dejected</li> |
| 270 | <li>disheartened</li> |
| 271 | <li>depressed</li> |
| 272 | </ul> |
| 273 | </li> |
| 274 | <li>annoyed</li> |
Andrey Andreev | 53b8ef5 | 2012-11-08 21:38:53 +0200 | [diff] [blame] | 275 | <li>cross</li> |
| 276 | <li>angry</li> |
| 277 | </ul> |
| 278 | </li> |
| 279 | </ul> |
Derek Jones | 8ede1a2 | 2011-10-05 13:34:52 -0500 | [diff] [blame] | 280 | </li> |
| 281 | </ul> |
| 282 | |
Derek Jones | b8c283a | 2013-07-19 16:02:53 -0700 | [diff] [blame^] | 283 | .. function:: ol($list, $attributes = '') |
Andrey Andreev | 53b8ef5 | 2012-11-08 21:38:53 +0200 | [diff] [blame] | 284 | |
| 285 | :param array $list: List entries |
| 286 | :param array $attributes: HTML attributes |
| 287 | :returns: string |
| 288 | |
| 289 | Identical to :php:func:`ul()`, only it produces the <ol> tag for |
| 290 | ordered lists instead of <ul>. |
| 291 | |
Derek Jones | 8ede1a2 | 2011-10-05 13:34:52 -0500 | [diff] [blame] | 292 | meta() |
| 293 | ====== |
| 294 | |
Derek Jones | b8c283a | 2013-07-19 16:02:53 -0700 | [diff] [blame^] | 295 | .. function:: meta($name = '', $content = '', $type = 'name', $newline = "\n") |
Derek Jones | 8ede1a2 | 2011-10-05 13:34:52 -0500 | [diff] [blame] | 296 | |
Andrey Andreev | 53b8ef5 | 2012-11-08 21:38:53 +0200 | [diff] [blame] | 297 | :param string $name: Meta name |
| 298 | :param string $content: Meta content |
| 299 | :param string $type: Meta type |
| 300 | :param string $newline: Newline character |
| 301 | :returns: string |
| 302 | |
| 303 | Helps you generate meta tags. You can pass strings to the function, or |
| 304 | simple arrays, or multidimensional ones. |
| 305 | |
| 306 | Examples:: |
Derek Jones | 8ede1a2 | 2011-10-05 13:34:52 -0500 | [diff] [blame] | 307 | |
| 308 | echo meta('description', 'My Great site'); |
| 309 | // Generates: <meta name="description" content="My Great Site" /> |
| 310 | |
| 311 | echo meta('Content-type', 'text/html; charset=utf-8', 'equiv'); |
| 312 | // Note the third parameter. Can be "equiv" or "name" |
| 313 | // Generates: <meta http-equiv="Content-type" content="text/html; charset=utf-8" /> |
| 314 | |
| 315 | echo meta(array('name' => 'robots', 'content' => 'no-cache')); |
| 316 | // Generates: <meta name="robots" content="no-cache" /> |
| 317 | |
Andrey Andreev | 53b8ef5 | 2012-11-08 21:38:53 +0200 | [diff] [blame] | 318 | $meta = array( |
Derek Jones | 8ede1a2 | 2011-10-05 13:34:52 -0500 | [diff] [blame] | 319 | array( |
| 320 | 'name' => 'robots', |
| 321 | 'content' => 'no-cache' |
| 322 | ), |
| 323 | array( |
| 324 | 'name' => 'description', |
| 325 | 'content' => 'My Great Site' |
| 326 | ), |
| 327 | array( |
| 328 | 'name' => 'keywords', |
| 329 | 'content' => 'love, passion, intrigue, deception' |
Andrey Andreev | 53b8ef5 | 2012-11-08 21:38:53 +0200 | [diff] [blame] | 330 | ), |
Derek Jones | 8ede1a2 | 2011-10-05 13:34:52 -0500 | [diff] [blame] | 331 | array( |
| 332 | 'name' => 'robots', |
| 333 | 'content' => 'no-cache' |
| 334 | ), |
| 335 | array( |
| 336 | 'name' => 'Content-type', |
| 337 | 'content' => 'text/html; charset=utf-8', 'type' => 'equiv' |
| 338 | ) |
| 339 | ); |
| 340 | |
| 341 | echo meta($meta); |
| 342 | // Generates: |
| 343 | // <meta name="robots" content="no-cache" /> |
| 344 | // <meta name="description" content="My Great Site" /> |
| 345 | // <meta name="keywords" content="love, passion, intrigue, deception" /> |
| 346 | // <meta name="robots" content="no-cache" /> |
| 347 | // <meta http-equiv="Content-type" content="text/html; charset=utf-8" /> |
| 348 | |
| 349 | doctype() |
| 350 | ========= |
| 351 | |
Derek Jones | b8c283a | 2013-07-19 16:02:53 -0700 | [diff] [blame^] | 352 | .. function:: doctype($type = 'xhtml1-strict') |
Andrey Andreev | 53b8ef5 | 2012-11-08 21:38:53 +0200 | [diff] [blame] | 353 | |
| 354 | :param string $type: Doctype name |
| 355 | |
Derek Jones | 8ede1a2 | 2011-10-05 13:34:52 -0500 | [diff] [blame] | 356 | Helps you generate document type declarations, or DTD's. XHTML 1.0 |
| 357 | Strict is used by default, but many doctypes are available. |
| 358 | |
Andrey Andreev | 53b8ef5 | 2012-11-08 21:38:53 +0200 | [diff] [blame] | 359 | Example:: |
Derek Jones | 8ede1a2 | 2011-10-05 13:34:52 -0500 | [diff] [blame] | 360 | |
| 361 | echo doctype(); // <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> |
| 362 | |
| 363 | echo doctype('html4-trans'); // <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> |
| 364 | |
| 365 | The following is a list of doctype choices. These are configurable, and |
| 366 | pulled from application/config/doctypes.php |
| 367 | |
Iban Eguia | 0baf232 | 2012-01-27 20:21:43 +0100 | [diff] [blame] | 368 | +-------------------------------+------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ |
| 369 | | Doctype | Option | Result | |
| 370 | +===============================+==============================+==================================================================================================================================================+ |
| 371 | | XHTML 1.1 | doctype('xhtml11') | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> | |
| 372 | +-------------------------------+------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ |
| 373 | | XHTML 1.0 Strict | doctype('xhtml1-strict') | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |
| 374 | +-------------------------------+------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ |
| 375 | | XHTML 1.0 Transitional | doctype('xhtml1-trans') | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
| 376 | +-------------------------------+------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ |
| 377 | | XHTML 1.0 Frameset | doctype('xhtml1-frame') | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd"> | |
| 378 | +-------------------------------+------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ |
| 379 | | XHTML Basic 1.1 | doctype('xhtml-basic11') | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML Basic 1.1//EN" "http://www.w3.org/TR/xhtml-basic/xhtml-basic11.dtd"> | |
| 380 | +-------------------------------+------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ |
| 381 | | HTML 5 | doctype('html5') | <!DOCTYPE html> | |
| 382 | +-------------------------------+------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ |
| 383 | | HTML 4 Strict | doctype('html4-strict') | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> | |
| 384 | +-------------------------------+------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ |
| 385 | | HTML 4 Transitional | doctype('html4-trans') | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> | |
| 386 | +-------------------------------+------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ |
| 387 | | HTML 4 Frameset | doctype('html4-frame') | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd"> | |
| 388 | +-------------------------------+------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ |
| 389 | | MathML 1.01 | doctype('mathml1') | <!DOCTYPE math SYSTEM "http://www.w3.org/Math/DTD/mathml1/mathml.dtd"> | |
| 390 | +-------------------------------+------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ |
| 391 | | MathML 2.0 | doctype('mathml2') | <!DOCTYPE math PUBLIC "-//W3C//DTD MathML 2.0//EN" "http://www.w3.org/Math/DTD/mathml2/mathml2.dtd"> | |
| 392 | +-------------------------------+------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ |
| 393 | | SVG 1.0 | doctype('svg10') | <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN" "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd"> | |
| 394 | +-------------------------------+------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ |
| 395 | | SVG 1.1 Full | doctype('svg11') | <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> | |
| 396 | +-------------------------------+------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ |
| 397 | | SVG 1.1 Basic | doctype('svg11-basic') | <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Basic//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-basic.dtd"> | |
| 398 | +-------------------------------+------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ |
| 399 | | SVG 1.1 Tiny | doctype('svg11-tiny') | <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd"> | |
| 400 | +-------------------------------+------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ |
| 401 | | XHTML+MathML+SVG (XHTML host) | doctype('xhtml-math-svg-xh') | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN" "http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd"> | |
| 402 | +-------------------------------+------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ |
| 403 | | XHTML+MathML+SVG (SVG host) | doctype('xhtml-math-svg-sh') | <!DOCTYPE svg:svg PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN" "http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd"> | |
| 404 | +-------------------------------+------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ |
| 405 | | XHTML+RDFa 1.0 | doctype('xhtml-rdfa-1') | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd"> | |
| 406 | +-------------------------------+------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ |
| 407 | | XHTML+RDFa 1.1 | doctype('xhtml-rdfa-2') | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.1//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-2.dtd"> | |
| 408 | +-------------------------------+------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ |