summaryrefslogtreecommitdiffstats
path: root/user_guide/helpers/html_helper.html
diff options
context:
space:
mode:
authorDerek Allard <derek.allard@ellislab.com>2008-01-30 21:16:01 +0100
committerDerek Allard <derek.allard@ellislab.com>2008-01-30 21:16:01 +0100
commitf653a2fe2f82130ff9d8db6a4913b4823dd81424 (patch)
tree40e6889a4979b925ab991f22a62e77b831774c71 /user_guide/helpers/html_helper.html
parent0684897f89f8363dc431e8ade0535bce521a7af2 (diff)
added img() to HTML helper
Diffstat (limited to 'user_guide/helpers/html_helper.html')
-rw-r--r--user_guide/helpers/html_helper.html22
1 files changed, 21 insertions, 1 deletions
diff --git a/user_guide/helpers/html_helper.html b/user_guide/helpers/html_helper.html
index d230a6630..42f467d27 100644
--- a/user_guide/helpers/html_helper.html
+++ b/user_guide/helpers/html_helper.html
@@ -78,7 +78,27 @@ Directory Helper
second the size of the heading. Example:</p>
<code>echo heading('Welcome!', 3);</code>
<p>The above would produce: &lt;h3>Welcome!&lt;/h3></p>
-
+<h2>img()</h2>
+<p>Lets you create HTML &lt;img /&gt; tags. The first parameter contains the image source. There is data, the
+ second the size of the heading. Example:</p>
+<code>img('images/picture.jpg');<br />
+// gives &lt;img src=&quot;http://site.com/images/picture.jpg&quot; /&gt;</code>
+<p>There is an optional second parameter that is a TRUE/FALSE value that specifics if the src should have the page specified by $config['index_page'] added to the address it creates. Presumably, this would be if you were using a media controller.</p>
+<p><code>img('images/picture.jpg', TRUE);<br />
+// gives &lt;img src=&quot;http://site.com/index.php/images/picture.jpg&quot; /&gt;</code></p>
+<p>Additionally, an associative array can be passed to the img() function for complete control over all attributes and values.</p>
+<p><code> $image_properties = array(<br />
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'src' =&gt; 'images/picture.jpg',<br />
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'alt' =&gt; 'Me, demonstrating how to eat 4 slices of pizza at one time',<br />
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'class' =&gt; 'post_images',<br />
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'width' =&gt; '200',<br />
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'height' =&gt; '200',<br />
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'title' =&gt; 'That was quite a night',<br />
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'rel' =&gt; 'lightbox',<br />
+ );<br />
+ <br />
+ img($image_properties);<br />
+ // &lt;img src=&quot;http://site.com/index.php/images/picture.jpg&quot; alt=&quot;Me, demonstrating how to eat 4 slices of pizza at one time&quot; class=&quot;post_images&quot; width=&quot;200&quot; height=&quot;200&quot; title=&quot;That was quite a night&quot; rel=&quot;lightbox&quot; /&gt;</code></p>
<h2>link_tag()</h2>
<p>Lets you create HTML &lt;link /> tags. This is useful for stylesheet links, as well as other links. The parameters are href, with optional rel, type, title, media and index_page. index_page is a TRUE/FALSE value that specifics if the href should have the page specified by $config['index_page'] added to the address it creates.<code>
link_tag('css/mystyles.css');<br />