From 9133d6e662be5f95400f13e36359345f8a027a45 Mon Sep 17 00:00:00 2001 From: admin Date: Sun, 29 Oct 2006 20:17:04 +0000 Subject: --- user_guide/helpers/html_helper.html | 118 ++++++++++++++++++++++++++++++++++++ 1 file changed, 118 insertions(+) (limited to 'user_guide/helpers') 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:

The above would produce: <h3>Welcome!</h3>

+

ol()  and  ul()

+ +

Permits you to generate ordered or unordered HTML lists from simple or multi-dimensional arrays. Example:

+ + +$this->load->helper('html');
+
+$list = array(
+            'red',
+            'blue',
+            'green',
+            'yellow'
+            );
+
+$attributes = array(
+                    'class' => 'boldlist',
+                    'id'    => 'mylist'
+                    );
+
+echo ul($list, $attributes);
+
+ +

The above code will produce this:

+ + +<ul class="boldlist" id="mylist">
+  <li>red</li>
+  <li>blue</li>
+  <li>green</li>
+  <li>yellow</li>
+</ul> +
+ +

Here is a more complex example, using a multi-dimensional array:

+ + +$this->load->helper('html');
+
+$list = array(
+            'colors' => array(
+                                'red',
+                                'blue',
+                                'green'
+                            ),
+            'shapes' => array(
+                                'round',
+                                'square',
+                                'circles' => array(
+                                                    'ellipse',
+                                                    'oval',
+                                                    'sphere'
+                                                    )
+                            ),
+            'moods'    => array(
+                                'happy',
+                                'upset' => array(
+                                                    'defeated' => array(
+                                                                        'dejected',
+                                                                        'disheartened',
+                                                                        'depressed'
+                                                                        ),
+                                                    'annoyed',
+                                                    'cross',
+                                                    'angry'
+                                                )
+                            )
+            );
+
+
+echo ul($list);
+ +

The above code will produce this:

+ + +<ul class="boldlist" id="mylist">
+  <li>colors
+    <ul>
+      <li>red</li>
+      <li>blue</li>
+      <li>green</li>
+    </ul>
+  </li>
+  <li>shapes
+    <ul>
+      <li>round</li>
+      <li>suare</li>
+      <li>circles
+        <ul>
+          <li>elipse</li>
+          <li>oval</li>
+          <li>sphere</li>
+        </ul>
+      </li>
+    </ul>
+  </li>
+  <li>moods
+    <ul>
+      <li>happy</li>
+      <li>upset
+        <ul>
+          <li>defeated
+            <ul>
+              <li>dejected</li>
+              <li>disheartened</li>
+              <li>depressed</li>
+            </ul>
+          </li>
+          <li>annoyed</li>
+          <li>cross</li>
+          <li>angry</li>
+        </ul>
+      </li>
+    </ul>
+  </li>
+</ul> +
+ +

nbs()

Generates non-breaking spaces (&nbsp;) based on the number you submit. Example:

echo nbs(3); -- cgit v1.2.3-24-g4f1b