admin | b0dd10f | 2006-08-25 17:25:49 +0000 | [diff] [blame] | 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
Derek Allard | afd99ac | 2008-01-19 19:59:14 +0000 | [diff] [blame] | 2 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
admin | b0dd10f | 2006-08-25 17:25:49 +0000 | [diff] [blame] | 3 | <head>
|
| 4 |
|
Derek Allard | 404e35d | 2007-08-07 01:00:45 +0000 | [diff] [blame] | 5 | <title>CodeIgniter User Guide : HTML Helper</title>
|
admin | b0dd10f | 2006-08-25 17:25:49 +0000 | [diff] [blame] | 6 |
|
| 7 | <style type='text/css' media='all'>@import url('../userguide.css');</style>
|
| 8 | <link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
|
| 9 |
|
admin | 17a890d | 2006-09-27 20:42:42 +0000 | [diff] [blame] | 10 | <script type="text/javascript" src="../nav/nav.js"></script>
|
admin | 2296fc3 | 2006-09-27 21:07:02 +0000 | [diff] [blame] | 11 | <script type="text/javascript" src="../nav/prototype.lite.js"></script>
|
admin | 17a890d | 2006-09-27 20:42:42 +0000 | [diff] [blame] | 12 | <script type="text/javascript" src="../nav/moo.fx.js"></script>
|
Derek Allard | b341237 | 2007-10-25 12:15:16 +0000 | [diff] [blame] | 13 | <script type="text/javascript" src="../nav/user_guide_menu.js"></script>
|
admin | b0dd10f | 2006-08-25 17:25:49 +0000 | [diff] [blame] | 14 |
|
| 15 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
| 16 | <meta http-equiv='expires' content='-1' />
|
| 17 | <meta http-equiv= 'pragma' content='no-cache' />
|
| 18 | <meta name='robots' content='all' />
|
Derek Allard | 3d879d5 | 2008-01-18 19:41:32 +0000 | [diff] [blame] | 19 | <meta name='author' content='ExpressionEngine Dev Team' />
|
Derek Allard | d2df9bc | 2007-04-15 17:41:17 +0000 | [diff] [blame] | 20 | <meta name='description' content='CodeIgniter User Guide' />
|
admin | b0dd10f | 2006-08-25 17:25:49 +0000 | [diff] [blame] | 21 |
|
| 22 | </head>
|
| 23 | <body>
|
| 24 |
|
| 25 | <!-- START NAVIGATION -->
|
| 26 | <div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
|
| 27 | <div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle.jpg" width="153" height="44" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
|
| 28 | <div id="masthead">
|
| 29 | <table cellpadding="0" cellspacing="0" border="0" style="width:100%">
|
| 30 | <tr>
|
Derek Allard | 39b622d | 2008-01-16 21:10:09 +0000 | [diff] [blame] | 31 | <td><h1>CodeIgniter User Guide Version 1.6.0</h1></td>
|
admin | c0d5d52 | 2006-10-30 19:40:35 +0000 | [diff] [blame] | 32 | <td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
|
admin | b0dd10f | 2006-08-25 17:25:49 +0000 | [diff] [blame] | 33 | </tr>
|
| 34 | </table>
|
| 35 | </div>
|
| 36 | <!-- END NAVIGATION -->
|
| 37 |
|
| 38 |
|
| 39 | <!-- START BREADCRUMB -->
|
| 40 | <table cellpadding="0" cellspacing="0" border="0" style="width:100%">
|
| 41 | <tr>
|
| 42 | <td id="breadcrumb">
|
Derek Jones | 7a9193a | 2008-01-21 18:39:20 +0000 | [diff] [blame] | 43 | <a href="http://codeigniter.com/">CodeIgniter Home</a> ›
|
admin | b0dd10f | 2006-08-25 17:25:49 +0000 | [diff] [blame] | 44 | <a href="../index.html">User Guide Home</a> ›
|
| 45 | Directory Helper
|
| 46 | </td>
|
Derek Allard | bc03091 | 2007-06-24 18:25:29 +0000 | [diff] [blame] | 47 | <td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" /> <input type="submit" class="submit" name="sa" value="Go" /></form></td>
|
admin | b0dd10f | 2006-08-25 17:25:49 +0000 | [diff] [blame] | 48 | </tr>
|
| 49 | </table>
|
| 50 | <!-- END BREADCRUMB -->
|
| 51 |
|
| 52 | <br clear="all" />
|
| 53 |
|
| 54 |
|
| 55 | <!-- START CONTENT -->
|
| 56 | <div id="content">
|
| 57 |
|
| 58 |
|
| 59 | <h1>HTML Helper</h1>
|
| 60 |
|
| 61 | <p>The HTML Helper file contains functions that assist in working with HTML.</p>
|
| 62 |
|
| 63 |
|
| 64 | <h2>Loading this Helper</h2>
|
| 65 |
|
| 66 | <p>This helper is loaded using the following code:</p>
|
| 67 | <code>$this->load->helper('html');</code>
|
| 68 |
|
| 69 | <p>The following functions are available:</p>
|
| 70 |
|
| 71 |
|
| 72 | <h2>heading()</h2>
|
| 73 |
|
| 74 | <p>Lets you create HTML <h1> tags. The first parameter will contain the data, the
|
| 75 | second the size of the heading. Example:</p>
|
| 76 |
|
| 77 | <code>echo heading('Welcome!', 3);</code>
|
| 78 |
|
| 79 | <p>The above would produce: <h3>Welcome!</h3></p>
|
| 80 |
|
| 81 |
|
admin | 9133d6e | 2006-10-29 20:17:04 +0000 | [diff] [blame] | 82 | <h2>ol() and ul()</h2>
|
| 83 |
|
| 84 | <p>Permits you to generate ordered or unordered HTML lists from simple or multi-dimensional arrays. Example:</p>
|
| 85 |
|
| 86 | <code>
|
| 87 | $this->load->helper('html');<br />
|
| 88 | <br />
|
| 89 | $list = array(<br />
|
| 90 | 'red', <br />
|
| 91 | 'blue', <br />
|
| 92 | 'green',<br />
|
| 93 | 'yellow'<br />
|
| 94 | );<br />
|
| 95 | <br />
|
| 96 | $attributes = array(<br />
|
| 97 | 'class' => 'boldlist',<br />
|
| 98 | 'id' => 'mylist'<br />
|
| 99 | );<br />
|
| 100 | <br />
|
| 101 | echo ul($list, $attributes);<br />
|
| 102 | </code>
|
| 103 |
|
| 104 | <p>The above code will produce this:</p>
|
| 105 |
|
| 106 | <code>
|
| 107 | <ul class="boldlist" id="mylist"><br />
|
| 108 | <li>red</li><br />
|
| 109 | <li>blue</li><br />
|
| 110 | <li>green</li><br />
|
| 111 | <li>yellow</li><br />
|
| 112 | </ul>
|
| 113 | </code>
|
| 114 |
|
| 115 | <p>Here is a more complex example, using a multi-dimensional array:</p>
|
| 116 |
|
| 117 | <code>
|
| 118 | $this->load->helper('html');<br />
|
| 119 | <br />
|
| 120 | $list = array(<br />
|
| 121 | 'colors' => array(<br />
|
| 122 | 'red',<br />
|
| 123 | 'blue',<br />
|
| 124 | 'green'<br />
|
| 125 | ),<br />
|
| 126 | 'shapes' => array(<br />
|
| 127 | 'round', <br />
|
| 128 | 'square',<br />
|
| 129 | 'circles' => array(<br />
|
| 130 | 'ellipse', <br />
|
| 131 | 'oval', <br />
|
| 132 | 'sphere'<br />
|
| 133 | )<br />
|
| 134 | ),<br />
|
| 135 | 'moods' => array(<br />
|
| 136 | 'happy', <br />
|
| 137 | 'upset' => array(<br />
|
| 138 | 'defeated' => array(<br />
|
| 139 | 'dejected',<br />
|
| 140 | 'disheartened',<br />
|
| 141 | 'depressed'<br />
|
| 142 | ),<br />
|
| 143 | 'annoyed',<br />
|
| 144 | 'cross',<br />
|
| 145 | 'angry'<br />
|
| 146 | )<br />
|
| 147 | )<br />
|
| 148 | );<br />
|
| 149 | <br />
|
| 150 | <br />
|
| 151 | echo ul($list);</code>
|
| 152 |
|
| 153 | <p>The above code will produce this:</p>
|
| 154 |
|
| 155 | <code>
|
| 156 | <ul class="boldlist" id="mylist"><br />
|
| 157 | <li>colors<br />
|
| 158 | <ul><br />
|
| 159 | <li>red</li><br />
|
| 160 | <li>blue</li><br />
|
| 161 | <li>green</li><br />
|
| 162 | </ul><br />
|
| 163 | </li><br />
|
| 164 | <li>shapes<br />
|
| 165 | <ul><br />
|
| 166 | <li>round</li><br />
|
| 167 | <li>suare</li><br />
|
| 168 | <li>circles<br />
|
| 169 | <ul><br />
|
| 170 | <li>elipse</li><br />
|
| 171 | <li>oval</li><br />
|
| 172 | <li>sphere</li><br />
|
| 173 | </ul><br />
|
| 174 | </li><br />
|
| 175 | </ul><br />
|
| 176 | </li><br />
|
| 177 | <li>moods<br />
|
| 178 | <ul><br />
|
| 179 | <li>happy</li><br />
|
| 180 | <li>upset<br />
|
| 181 | <ul><br />
|
| 182 | <li>defeated<br />
|
| 183 | <ul><br />
|
| 184 | <li>dejected</li><br />
|
| 185 | <li>disheartened</li><br />
|
| 186 | <li>depressed</li><br />
|
| 187 | </ul><br />
|
| 188 | </li><br />
|
| 189 | <li>annoyed</li><br />
|
| 190 | <li>cross</li><br />
|
| 191 | <li>angry</li><br />
|
| 192 | </ul><br />
|
| 193 | </li><br />
|
| 194 | </ul><br />
|
| 195 | </li><br />
|
| 196 | </ul>
|
| 197 | </code>
|
| 198 |
|
| 199 |
|
admin | b0dd10f | 2006-08-25 17:25:49 +0000 | [diff] [blame] | 200 | <h2>nbs()</h2>
|
| 201 | <p>Generates non-breaking spaces (&nbsp;) based on the number you submit. Example:</p>
|
| 202 | <code>echo nbs(3);</code>
|
| 203 | <p>The above would produce: &nbsp;&nbsp;&nbsp;</p>
|
| 204 |
|
| 205 |
|
| 206 | <h2>br()</h2>
|
| 207 | <p>Generates line break tags (<br />) based on the number you submit. Example:</p>
|
| 208 | <code>echo br(3);</code>
|
| 209 | <p>The above would produce: <br /><br /><br /></p>
|
| 210 |
|
| 211 |
|
| 212 |
|
| 213 |
|
| 214 | </div>
|
| 215 | <!-- END CONTENT -->
|
| 216 |
|
| 217 |
|
| 218 | <div id="footer">
|
| 219 | <p>
|
| 220 | Previous Topic: <a href="form_helper.html">Form Helper</a>
|
| 221 | ·
|
| 222 | <a href="#top">Top of Page</a> ·
|
| 223 | <a href="../index.html">User Guide Home</a> ·
|
Derek Allard | 9da4dbc | 2007-04-03 11:39:35 +0000 | [diff] [blame] | 224 | Next Topic: <a href="inflector_helper.html"> Inflector Helper</a>
|
Derek Allard | c644128 | 2007-07-04 23:54:32 +0000 | [diff] [blame] | 225 | </p>
|
Derek Jones | 7a9193a | 2008-01-21 18:39:20 +0000 | [diff] [blame] | 226 | <p><a href="http://codeigniter.com">CodeIgniter</a> · Copyright © 2007 · <a href="http://ellislab.com/">Ellislab, Inc.</a></p>
|
admin | b0dd10f | 2006-08-25 17:25:49 +0000 | [diff] [blame] | 227 | </div>
|
| 228 |
|
| 229 | </body>
|
| 230 | </html> |