From 432e97322ad518468235649ad25974eef3f3d39f Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Wed, 30 Jan 2008 16:13:57 +0000 Subject: Added link() to the HTML helper. --- user_guide/helpers/html_helper.html | 54 ++++++++++++++++++++++++------------- 1 file changed, 36 insertions(+), 18 deletions(-) (limited to 'user_guide/helpers/html_helper.html') diff --git a/user_guide/helpers/html_helper.html b/user_guide/helpers/html_helper.html index e07f27778..7abe01af9 100644 --- a/user_guide/helpers/html_helper.html +++ b/user_guide/helpers/html_helper.html @@ -68,16 +68,49 @@ Directory Helper

The following functions are available:

+

br()

+

Generates line break tags (<br />) based on the number you submit. Example:

+echo br(3); +

The above would produce: <br /><br /><br />

heading()

-

Lets you create HTML <h1> tags. The first parameter will contain the data, the second the size of the heading. Example:

- echo heading('Welcome!', 3); -

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

+

link()

+

Lets you create HTML <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.

+

While stylesheets are more conveniently handled through the stylesheet() function, they can also be called here.

+ +link('css/mystyles.css');
+ // gives <link href="http://site.com/css/mystyles.css" rel="stylesheet" type="text/css" />
+

Further examples:

+ + +link('favicon.ico', 'shortcut icon', 'image/ico');
+ // <link href="http://site.com/favicon.ico" rel="shortcut icon" type="image/ico" />

+
+
+link('feed', 'alternate', 'application/rss+xml', 'My RSS Feed');
+ // <link href="http://site.com/feed" rel="alternate" type="application/rss+xml" title="My RSS Feed" />
+
+ +
+$link = array(
+           'href' => 'css/printer.css',
+           'rel' => 'stylesheet',
+           'type' => 'text/css',
+           'media' => 'print'
+ );
+
+ link($link);
+ // <link href="http://site.com/css/printer.css" rel="stylesheet" type="text/css" media="print" />
+ +

nbs()

+

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

+echo nbs(3); +

The above would produce: &nbsp;&nbsp;&nbsp;

ol()  and  ul()

@@ -196,21 +229,6 @@ echo ul($list); </ul> - -

nbs()

-

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

-echo nbs(3); -

The above would produce: &nbsp;&nbsp;&nbsp;

- - -

br()

-

Generates line break tags (<br />) based on the number you submit. Example:

-echo br(3); -

The above would produce: <br /><br /><br />

- - - - -- cgit v1.2.3-24-g4f1b