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