diff options
author | Derek Allard <derek.allard@ellislab.com> | 2008-01-30 21:16:01 +0100 |
---|---|---|
committer | Derek Allard <derek.allard@ellislab.com> | 2008-01-30 21:16:01 +0100 |
commit | f653a2fe2f82130ff9d8db6a4913b4823dd81424 (patch) | |
tree | 40e6889a4979b925ab991f22a62e77b831774c71 /user_guide | |
parent | 0684897f89f8363dc431e8ade0535bce521a7af2 (diff) |
added img() to HTML helper
Diffstat (limited to 'user_guide')
-rw-r--r-- | user_guide/changelog.html | 1 | ||||
-rw-r--r-- | user_guide/helpers/html_helper.html | 22 |
2 files changed, 22 insertions, 1 deletions
diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 4124540aa..908037a67 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -132,6 +132,7 @@ Change Log <li>Helpers & Plugins
<ul>
<li>Added link_tag() to the <a href="./helpers/html_helper.html">HTML helper.</a></li>
+ <li>Added img() to the <a href="./helpers/html_helper.html">HTML helper.</a></li>
<li>Added ability to <a href="./general/helpers.html">"extend" Helpers</a>.</li>
<li>Added an <a href="./helpers/email_helper.html">email helper</a> into core helpers.</li>
<li>Added <kbd>strip_quotes()</kbd> function to <a href="./helpers/string_helper.html">string helper</a>.</li>
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: <h3>Welcome!</h3></p>
-
+<h2>img()</h2>
+<p>Lets you create HTML <img /> 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 <img src="http://site.com/images/picture.jpg" /></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 <img src="http://site.com/index.php/images/picture.jpg" /></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 />
+ 'src' => 'images/picture.jpg',<br />
+ 'alt' => 'Me, demonstrating how to eat 4 slices of pizza at one time',<br />
+ 'class' => 'post_images',<br />
+ 'width' => '200',<br />
+ 'height' => '200',<br />
+ 'title' => 'That was quite a night',<br />
+ 'rel' => 'lightbox',<br />
+ );<br />
+ <br />
+ img($image_properties);<br />
+ // <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" /></code></p>
<h2>link_tag()</h2>
<p>Lets you create HTML <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 />
|