diff options
author | admin <devnull@localhost> | 2006-10-29 21:17:04 +0100 |
---|---|---|
committer | admin <devnull@localhost> | 2006-10-29 21:17:04 +0100 |
commit | 9133d6e662be5f95400f13e36359345f8a027a45 (patch) | |
tree | 8d1d05352286d056e30f40a82caf3290c50e7480 /user_guide/helpers/html_helper.html | |
parent | 5ed8bf334fa9714db3cb71cd3ec3bfcb6f5e4c98 (diff) |
Diffstat (limited to 'user_guide/helpers/html_helper.html')
-rw-r--r-- | user_guide/helpers/html_helper.html | 118 |
1 files changed, 118 insertions, 0 deletions
diff --git a/user_guide/helpers/html_helper.html b/user_guide/helpers/html_helper.html index 727431062..303adc349 100644 --- a/user_guide/helpers/html_helper.html +++ b/user_guide/helpers/html_helper.html @@ -84,6 +84,124 @@ second the size of the heading. Example:</p> <p>The above would produce: <h3>Welcome!</h3></p>
+<h2>ol() and ul()</h2>
+
+<p>Permits you to generate ordered or unordered HTML lists from simple or multi-dimensional arrays. Example:</p>
+
+<code>
+$this->load->helper('html');<br />
+<br />
+$list = array(<br />
+ 'red', <br />
+ 'blue', <br />
+ 'green',<br />
+ 'yellow'<br />
+ );<br />
+<br />
+$attributes = array(<br />
+ 'class' => 'boldlist',<br />
+ 'id' => 'mylist'<br />
+ );<br />
+<br />
+echo ul($list, $attributes);<br />
+</code>
+
+<p>The above code will produce this:</p>
+
+<code>
+<ul class="boldlist" id="mylist"><br />
+ <li>red</li><br />
+ <li>blue</li><br />
+ <li>green</li><br />
+ <li>yellow</li><br />
+</ul>
+</code>
+
+<p>Here is a more complex example, using a multi-dimensional array:</p>
+
+<code>
+$this->load->helper('html');<br />
+<br />
+$list = array(<br />
+ 'colors' => array(<br />
+ 'red',<br />
+ 'blue',<br />
+ 'green'<br />
+ ),<br />
+ 'shapes' => array(<br />
+ 'round', <br />
+ 'square',<br />
+ 'circles' => array(<br />
+ 'ellipse', <br />
+ 'oval', <br />
+ 'sphere'<br />
+ )<br />
+ ),<br />
+ 'moods' => array(<br />
+ 'happy', <br />
+ 'upset' => array(<br />
+ 'defeated' => array(<br />
+ 'dejected',<br />
+ 'disheartened',<br />
+ 'depressed'<br />
+ ),<br />
+ 'annoyed',<br />
+ 'cross',<br />
+ 'angry'<br />
+ )<br />
+ )<br />
+ );<br />
+<br />
+<br />
+echo ul($list);</code>
+
+<p>The above code will produce this:</p>
+
+<code>
+<ul class="boldlist" id="mylist"><br />
+ <li>colors<br />
+ <ul><br />
+ <li>red</li><br />
+ <li>blue</li><br />
+ <li>green</li><br />
+ </ul><br />
+ </li><br />
+ <li>shapes<br />
+ <ul><br />
+ <li>round</li><br />
+ <li>suare</li><br />
+ <li>circles<br />
+ <ul><br />
+ <li>elipse</li><br />
+ <li>oval</li><br />
+ <li>sphere</li><br />
+ </ul><br />
+ </li><br />
+ </ul><br />
+ </li><br />
+ <li>moods<br />
+ <ul><br />
+ <li>happy</li><br />
+ <li>upset<br />
+ <ul><br />
+ <li>defeated<br />
+ <ul><br />
+ <li>dejected</li><br />
+ <li>disheartened</li><br />
+ <li>depressed</li><br />
+ </ul><br />
+ </li><br />
+ <li>annoyed</li><br />
+ <li>cross</li><br />
+ <li>angry</li><br />
+ </ul><br />
+ </li><br />
+ </ul><br />
+ </li><br />
+</ul>
+</code>
+
+
<h2>nbs()</h2>
<p>Generates non-breaking spaces (&nbsp;) based on the number you submit. Example:</p>
<code>echo nbs(3);</code>
|