Show
Ignore:
Timestamp:
09/04/2007 01:43:13 PM (15 months ago)
Author:
OscarB
Message:

UG Updates, add helpers content, file,html,text and url

Location:
trunk/modules/user_guide/views/user_guide/en/helpers
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • trunk/modules/user_guide/views/user_guide/en/helpers/file.php

    r447 r496  
    1 Article status [Stub] requires [Writing] Describe file helper class and usage 
     1Article status [First Draft] requires [Editing] Add parameter descriptions 
    22# File Helper 
    3 This is a stub (please write me) 
     3Provides methods for splitting and joining FILES. 
     4 
     5### Split a file into segments. 
     6The **file::split()** method accepts multiple parameters. Only the input **filename** is required. 
     7Returns the number of file segments created. 
     8<code> 
     9$segments = file::split($filename, $output_directory = FALSE, $piece_size = 10); 
     10</code> 
     11 
     12### Join segments of a split file. 
     13The **file::join()** method accepts multiple parameters. Only the input segment **filename** is required. 
     14Returns the number of file segments joined. 
     15<code> 
     16$segments = file::split($filename, $output_file = FALSE); 
     17</code> 
  • trunk/modules/user_guide/views/user_guide/en/helpers/html.php

    r447 r496  
    1 Article status [Stub] requires [Writing] Describe html helper class and usage 
     1Article status [First Draft] requires [Editing] Complete and Describe parameters 
    22# HTML Helper 
    3 This is a stub (please write me) 
     3Provides methods for html generation. 
     4 
     5### Convert special characters to HTML entities 
     6The **html::specialchars()** method accepts multiple parameters. Only the input **string** is required. 
     7Converts special characters to HTML entities using a UFT-8 character set. 
     8 
     9<code> 
     10$encoded_string = html::specialchars($string, $double_encode = TRUE); 
     11</code> 
     12 
     13### Generate an HTML anchor link 
     14The **html::anchor()** method accepts multiple parameters. Only the url segment(s) are required. 
     15 
     16A standard HTML anchor link is generated. If you want to generate a link that is internal to your website, 
     17pass only the url segments to the function, and the anchor is automatically constructed from the site url 
     18defined in <file>config</file> 
     19 
     20<code> 
     21echo html::anchor('pub/articles/7', 'Articles', array('title' => 'Fuel price increase!')); 
     22</code> 
     23 
     24Generates <code>&lt;a href="http://example.com/index.php/pub/articles/7" title="Fuel price increase!"&gt;Articles&lt;/a&gt;</code> 
     25 
     26<?php /* $Id$ */ ?> 
  • trunk/modules/user_guide/views/user_guide/en/helpers/text.php

    r454 r496  
    1 Article status [Stub] requires [Writing] Describe text helper class and usage 
     1Article status [First Draft] requires [Editing] Describe parameters 
    22# Text Helper 
    3 This is a stub (please write me) 
     3Provides methods for working with TEXT. 
     4 
     5### Word Limiter 
     6The **text::limit_words()** method accepts multiple parameters. Only the input **string** is required. 
     7The default end character is the ellipsis. 
     8<pre> 
     9<code> 
     10$long_description = 'The rain in Spain falls mainly in the plain'; 
     11$limit = 4; 
     12$end_char = '&amp;nbsp;'; 
     13 
     14$short_description = html::limit_words($long_description, $limit, $end_char); 
     15</code> 
     16</pre> 
     17Generates: <pre>The rain in Spain </pre> 
     18 
     19 
     20### Character Limiter 
     21The **text::limit_chars()** method accepts multiple parameters. Only the input **string** is required. 
     22The default end character is the ellipsis. 
     23<pre> 
     24<code> 
     25$long_description = 'The rain in Spain falls mainly in the plain'; 
     26$limit = 4; 
     27$end_char = '&amp;nbsp;'; 
     28$preserve_words = FALSE; 
     29 
     30$short_description = html::limit_chars($long_description, $limit, $end_char, $preserve_words); 
     31</code> 
     32</pre> 
     33Generates: <pre>The r </pre> 
  • trunk/modules/user_guide/views/user_guide/en/helpers/url.php

    r447 r496  
    1 Article status [Stub] requires [Writing] Describe url helper class and usage 
     1Article status [First Draft] requires [Editing] Complete and Describe parameters 
    22# URL Helper 
    3 This is a stub (please write me) 
     3Provides methods for working with Uniform Resource Locators 
     4 
     5### Base URL 
     6The **url::base()** method accepts one **optional** parameter. 
     7Returns the *base_url* defined in <file>config</file> 
     8 
     9<code>echo url::base();</code> 
     10 
     11### Site URL 
     12The **url::site()** method accepts one **mandatory** parameter. 
     13Returns a url, based on the *base_url*, *index_page*, *url_suffix* defined in <file>config</file> and the url segments passed to the method. 
     14 
     15<code>echo url::site($uri);</code> 
     16 
     17### Title 
     18The **url::title()** method accepts multiple parameters. Only the input **title** string is mandatory. 
     19Returns a properly formatted title, for use in a URI. 
     20 
     21<pre> 
     22<code> 
     23$input_title = " _Eclectic title's entered by crazed users- ?&gt;  "; 
     24 
     25echo url::title($input_title, $seperator = '_'); 
     26</code> 
     27</pre> 
     28 
     29Generates: <pre>Eclectic_titles_entered_by_crazed_users-</pre> 
     30 
     31### Redirect 
     32The **url::redirect()** method accepts multiple **optional** parameters. 
     33Generates an HTTP Server Header (302), which will redirect the browser to a specified URL, *base_url* by default. 
     34 
     35<code>url::redirect("www.whitehouse.gov");</code>