summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDerek Allard <derek.allard@ellislab.com>2008-01-30 17:55:30 +0100
committerDerek Allard <derek.allard@ellislab.com>2008-01-30 17:55:30 +0100
commit0684897f89f8363dc431e8ade0535bce521a7af2 (patch)
tree956709e818d47e812e3aefb06ad7d7473cd3769f
parentf45c677e1432126fc4863c842ea36a494016e692 (diff)
remove stylesheet() so as not to overly pollute function names, rename link() to link_tag() to avoid PHP collision.
-rw-r--r--system/helpers/html_helper.php23
-rw-r--r--user_guide/changelog.html3
-rw-r--r--user_guide/helpers/html_helper.html23
3 files changed, 9 insertions, 40 deletions
diff --git a/system/helpers/html_helper.php b/system/helpers/html_helper.php
index 660d867bd..f88bc0723 100644
--- a/system/helpers/html_helper.php
+++ b/system/helpers/html_helper.php
@@ -238,9 +238,9 @@ if (! function_exists('image'))
* @param boolean should index_page be added to the css path
* @return string
*/
-if (! function_exists('link'))
+if (! function_exists('link_tag'))
{
- function link($href = '', $rel = 'stylesheet', $type = 'text/css', $title = '', $media = '', $index_page = FALSE)
+ function link_tag($href = '', $rel = 'stylesheet', $type = 'text/css', $title = '', $media = '', $index_page = FALSE)
{
$CI =& get_instance();
@@ -307,25 +307,6 @@ if (! function_exists('link'))
// ------------------------------------------------------------------------
/**
- * Stylesheet
- *
- * Generates a <link /> to a CSS
- *
- * @access public
- * @param array
- * @return string
- */
-if (! function_exists('stylesheet'))
-{
- function stylesheet($href = '', $rel = 'stylesheet', $title = '', $media = 'screen')
- {
- return link($href, $rel, 'text/css', $title, $media);
- }
-}
-
-// ------------------------------------------------------------------------
-
-/**
* Generates meta tags from an array of key/values
*
* @access public
diff --git a/user_guide/changelog.html b/user_guide/changelog.html
index fb2830e3c..4124540aa 100644
--- a/user_guide/changelog.html
+++ b/user_guide/changelog.html
@@ -131,8 +131,7 @@ Change Log
<li>Helpers &amp; Plugins
<ul>
- <li>Added link() to the <a href="./helpers/html_helper.html">HTML helper.</a></li>
- <li>Added stylesheet() to the <a href="./helpers/html_helper.html">HTML helper.</a></li>
+ <li>Added link_tag() 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 5ddadd717..d230a6630 100644
--- a/user_guide/helpers/html_helper.html
+++ b/user_guide/helpers/html_helper.html
@@ -79,16 +79,14 @@ 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>link()</h2>
-<p>Lets you create HTML &lt;link /> tags. 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.</p>
-<p>While stylesheets are more conveniently handled through the stylesheet() function, they can also be called here.</p>
-<code>
-link('css/mystyles.css');<br />
- // gives &lt;link href=&quot;http://site.com/css/mystyles.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot; /&gt;</code>
+<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 />
+// gives &lt;link href=&quot;http://site.com/css/mystyles.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot; /&gt;</code></p>
<p>Further examples:</p>
<code>
- link('favicon.ico', 'shortcut icon', 'image/ico');<br />
+ link_tag('favicon.ico', 'shortcut icon', 'image/ico');<br />
// &lt;link href=&quot;http://site.com/favicon.ico&quot; rel=&quot;shortcut icon&quot; type=&quot;image/ico&quot; /&gt;
<br />
<br />
@@ -103,18 +101,9 @@ link('css/mystyles.css');<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'media' =&gt; 'print'<br />
);<br />
<br />
- link($link);<br />
+ link_tag($link);<br />
// &lt;link href=&quot;http://site.com/css/printer.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot; media=&quot;print&quot; /&gt;</code></p>
-<h2>stylesheet()</h2>
-<p>The stylesheet() function simplifies the linking of CSS into your document. The arguments are stylesheet(href, optional rel, optional title, optional media).</p>
-<p>For more complete control over the output of the tag, you may want to use the link() function.</p>
-<code>stylesheet('foo.css');<br />
- // &lt;link href=&quot;http://site.com/foo.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot; media=&quot;screen&quot; /&gt;<br />
-<br />
-stylesheet('foo.css', 'alternate stylesheet', 'black and white version', 'screen') .'&lt;br&gt;';<br />
- // &lt;link href=&quot;http://site.com/foo.css&quot; rel=&quot;alternate stylesheet&quot; type=&quot;text/css&quot; media=&quot;screen&quot; title=&quot;black and white version&quot; /&gt;
-</code>
<h2>nbs()</h2>
<p>Generates non-breaking spaces (&amp;nbsp;) based on the number you submit. Example:</p>
<code>echo nbs(3);</code>