Changeset 1764

Show
Ignore:
Timestamp:
01/21/2008 05:33:31 AM (12 months ago)
Author:
PugFish
Message:

The last of the helper's comments converted

Location:
trunk/system/helpers
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/system/helpers/html.php

    r1710 r1764  
    33 * HTML helper class. 
    44 * 
    5  * $Id:$ 
     5 * $Id$ 
    66 * 
    77 * @package    Core 
     
    1313 
    1414        /** 
    15          * Method: specialchars 
    16          *  Convert special characters to HTML entities 
    17          * 
    18          * Parameters: 
    19          *  str           - string to convert 
    20          *  double_encode - encode existing entities 
    21          * 
    22          * Returns: 
    23          *  Entity-encoded string. 
     15         * Convert special characters to HTML entities 
     16         * 
     17         * @param   string   string to convert 
     18         * @param   boolean  encode existing entities 
     19         * @return  string 
    2420         */ 
    2521        public static function specialchars($str, $double_encode = TRUE) 
     
    4945 
    5046        /** 
    51          * Method: query_string 
    52          *  Creates an HTTP query string from an array. 
    53          * 
    54          * Parameters: 
    55          *  array - array of data to convert to string 
    56          * 
    57          * Returns: 
    58          *  An HTTP query string. 
     47         * Creates an HTTP query string from an array. 
     48         * 
     49         * @param   array   array of data to convert to string 
     50         * @return  string 
    5951         */ 
    6052        public static function query_string($array) 
     
    7466 
    7567        /** 
    76          * Method: anchor 
    77          *  Create HTML link anchors. 
    78          * 
    79          * Parameters: 
    80          *  uri        - URL or URI string 
    81          *  title      - link text 
    82          *  attributes - HTML anchor attributes 
    83          *  protocol   - non-default protocol, eg: https 
    84          * 
    85          * Returns: 
    86          *  An HTML link anchor. 
     68         * Create HTML link anchors. 
     69         * 
     70         * @param   string  URL or URI string 
     71         * @param   string  link text 
     72         * @param   array   HTML anchor attributes 
     73         * @param   string  non-default protocol, eg: https 
     74         * @return  string 
    8775         */ 
    8876        public static function anchor($uri, $title = FALSE, $attributes = FALSE, $protocol = FALSE) 
     
    11199 
    112100        /** 
    113          * Method: file_anchor 
    114          *  Creates an HTML anchor to a file. 
    115          * 
    116          * Parameters: 
    117          *  file       - name of file to link to 
    118          *  title      - link text 
    119          *  attributes - HTML anchor attributes 
    120          *  protocol   - non-default protocol, eg: ftp 
    121          * 
    122          * Returns: 
    123          *  An HTML link anchor. 
     101         * Creates an HTML anchor to a file. 
     102         * 
     103         * @param   string  name of file to link to 
     104         * @param   string  link text 
     105         * @param   array   HTML anchor attributes 
     106         * @param   string  non-default protocol, eg: ftp 
     107         * @return  string 
    124108         */ 
    125109        public static function file_anchor($file, $title = FALSE, $attributes = FALSE, $protocol = FALSE) 
     
    135119 
    136120        /** 
    137          * Method: panchor 
    138          *  Similar to anchor, but with the protocol parameter first. 
    139          * 
    140          * Parameters: 
    141          *  protocol   - link protocol 
    142          *  uri        - URI or URL to link to 
    143          *  title      - link text 
    144          *  attributes - HTML anchor attributes 
    145          * 
    146          * Returns: 
    147          *  An HTML link anchor. 
     121         * Similar to anchor, but with the protocol parameter first. 
     122         * 
     123         * @param   string  link protocol 
     124         * @param   string  URI or URL to link to 
     125         * @param   string  link text 
     126         * @param   array   HTML anchor attributes 
     127         * @return  string 
    148128         */ 
    149129        public static function panchor($protocol, $uri, $title = FALSE, $attributes = FALSE) 
     
    153133 
    154134        /** 
    155          * Method: mailto 
    156          *  Creates a email anchor. 
    157          * 
    158          * Parameters: 
    159          *  email      - email address to send to 
    160          *  title      - link text 
    161          *  attributes - HTML anchor attributes 
    162          * 
    163          * Returns: 
    164          *  An HTML link anchor. 
     135         * Creates a email anchor. 
     136         * 
     137         * @param   string  email address to send to 
     138         * @param   string  link text 
     139         * @param   array   HTML anchor attributes 
     140         * @return  string 
    165141         */ 
    166142        public static function mailto($email, $title = FALSE, $attributes = FALSE) 
     
    203179         * Generate a "breadcrumb" list of anchors representing the URI. 
    204180         * 
    205          * @param 
    206          * @return string 
     181         * @param   array   segments to use as breadcrumbs, defaults to using Router::$segments 
     182         * @return  string 
    207183         */ 
    208184        public static function breadcrumb($segments = NULL) 
     
    227203 
    228204        /** 
    229          * Method: stylesheet 
    230          *  Creates a stylesheet link. 
    231          * 
    232          * Parameters: 
    233          *  style - filename 
    234          *  media - media type of stylesheet 
    235          *  index  - include the index_page in the link 
    236          * 
    237          * Returns: 
    238          *  An HTML stylesheet link. 
     205         * Creates a stylesheet link. 
     206         * 
     207         * @param   string|array  filename, or array of filenames to match to array of medias 
     208         * @param   string|array  media type of stylesheet, or array to match filenames 
     209         * @param   boolean       include the index_page in the link 
     210         * @return  string 
    239211         */ 
    240212        public static function stylesheet($style, $media = FALSE, $index = TRUE) 
     
    244216 
    245217        /** 
    246          * Method: link 
    247          *  Creates a link tag. 
    248          * 
    249          * Parameters: 
    250          *  href   - filename 
    251      *  rel    - relationship 
    252      *  type   - mimetype 
    253      *  suffix - specifies suffix of the file 
    254          *  media  - specifies on what device the document will be displayed 
    255          *  index  - include the index_page in the link 
    256          * 
    257          * Returns: 
    258          *  An HTML stylesheet link. 
     218         * Creates a link tag. 
     219         * 
     220         * @param   string|array  filename 
     221         * @param   string|array  relationship 
     222         * @param   string|array  mimetype 
     223         * @param   string        specifies suffix of the file 
     224         * @param   string|array  specifies on what device the document will be displayed 
     225         * @param   boolean       include the index_page in the link 
     226         * @return  string 
    259227         */ 
    260228        public static function link($href, $rel, $type, $suffix = FALSE, $media = FALSE, $index = TRUE) 
     
    285253 
    286254        /** 
    287          * Method: script 
    288          *  Creates a script link. 
    289          * 
    290          * Parameters: 
    291          *  script - filename 
    292          *  index  - include the index_page in the link 
    293          * 
    294          * Returns: 
    295          *  An HTML script link. 
     255         * Creates a script link. 
     256         * 
     257         * @param   string|array  filename 
     258         * @param   boolean       include the index_page in the link 
     259         * @return  string 
    296260         */ 
    297261        public static function script($script, $index = TRUE) 
     
    317281 
    318282        /** 
    319          * Method: image 
    320          *  Creates a image link. 
    321          * 
    322          * Parameters: 
    323          *  attr  - array of html attributes, or an image name 
    324          *  index - include the index_page in the link 
    325          * 
    326          * Returns: 
    327          *  An HTML image link. 
     283         * Creates a image link. 
     284         * 
     285         * @param   string|array  array of html attributes, or an image name 
     286         * @param   boolean       include the index_page in the link 
     287         * @return  string 
    328288         */ 
    329289        public static function image($attr = NULL, $index = TRUE) 
     
    344304 
    345305        /** 
    346          * Method: attributes 
    347          *  Compiles an array of HTML attributes into an attribute string. 
    348          * 
    349          * Parameters: 
    350          *  attrs - array of attributes 
    351          * 
    352          * Returns: 
    353          *  HTML attribute string. 
     306         * Compiles an array of HTML attributes into an attribute string. 
     307         * 
     308         * @param   string|array  array of attributes 
     309         * @return  string 
    354310         */ 
    355311        public static function attributes($attrs) 
  • trunk/system/helpers/valid.php

    r1710 r1764  
    33 * Validation helper class. 
    44 * 
    5  * $Id:$ 
     5 * $Id$ 
    66 * 
    77 * @package    Validation 
     
    1313 
    1414        /** 
    15          * Method: email 
    16          *  Validate email, commonly used characters only 
    17          * 
    18          * Parameters: 
    19          *  email - email address 
    20          * 
    21          * Returns: 
    22          *  TRUE if email is valid, FALSE if not. 
     15         * Validate email, commonly used characters only 
     16         * 
     17         * @param   string   email address 
     18         * @return  boolean 
    2319         */ 
    2420        public static function email($email) 
     
    2824 
    2925        /** 
    30          * Method: email_rfc 
    31          *  Validate email, RFC compliant version 
    32          *  Note: This function is LESS strict than valid_email. Choose carefully. 
    33          * 
    34          *  Originally by Cal Henderson, modified to fit Kohana syntax standards: 
    35          *  - http://www.iamcal.com/publish/articles/php/parsing_email/ 
    36          *  - http://www.w3.org/Protocols/rfc822/ 
    37          * 
    38          * Parameters: 
    39          *  email - email address 
    40          * 
    41          * Returns: 
    42          *  TRUE if email is valid, FALSE if not. 
     26         * Validate email, RFC compliant version 
     27         * Note: This function is LESS strict than valid_email. Choose carefully. 
     28         * 
     29         * @see  Originally by Cal Henderson, modified to fit Kohana syntax standards: 
     30         * @see  http://www.iamcal.com/publish/articles/php/parsing_email/ 
     31         * @see  http://www.w3.org/Protocols/rfc822/ 
     32         * 
     33         * @param   string   email address 
     34         * @return  boolean 
    4335         */ 
    4436        public static function email_rfc($email) 
     
    6153 
    6254        /** 
    63          * Method: url 
    64          *  Validate URL 
    65          * 
    66          * Parameters: 
    67          *  url    - URL 
    68          *  scheme - protocol 
    69          * 
    70          * Returns: 
    71          *  TRUE if URL is valid, FALSE if not. 
     55         * Validate URL 
     56         * 
     57         * @param   string   URL 
     58         * @param   string   protocol 
     59         * @return  boolean 
    7260         */ 
    7361        public static function url($url, $scheme = 'http') 
     
    8472 
    8573        /** 
    86          * Method: ip 
    87          *  Validate IP 
    88          * 
    89          * Parameters: 
    90          *  ip - IP address 
    91          * 
    92          * Returns: 
    93          *  TRUE if IP address is valid, FALSE if not. 
     74         * Validate IP 
     75         * 
     76         * @param   string   IP address 
     77         * @return  boolean 
    9478         */ 
    9579        public static function ip($ip) 
     
    205189 
    206190        /** 
    207          * Method: alpha 
    208          *  Checks whether a string consists of alphabetical characters only 
    209          * 
    210          * Parameters: 
    211          *  str  - input string 
    212          *  utf8 - trigger UTF-8 compatibility 
    213          * 
    214          * Returns: 
    215          *  TRUE if string only contains alphabetical characters, FALSE if not. 
     191         * Checks whether a string consists of alphabetical characters only. 
     192         * 
     193         * @param   string   input string 
     194         * @param   boolean  trigger UTF-8 compatibility 
     195         * @return  boolean 
    216196         */ 
    217197        public static function alpha($str, $utf8 = FALSE) 
     
    223203 
    224204        /** 
    225          * Method: alpha_numeric 
    226          *  Checks whether a string consists of alphabetical characters and numbers only 
    227          * 
    228          * Parameters: 
    229          *  str  - input string 
    230          *  utf8 - trigger UTF-8 compatibility 
    231          * 
    232          * Returns: 
    233          *  TRUE if string only contains alphabetical characters and numbers, FALSE if not. 
     205         * Checks whether a string consists of alphabetical characters and numbers only. 
     206         * 
     207         * @param   string   input string 
     208         * @param   boolean  trigger UTF-8 compatibility 
     209         * @return  boolean 
    234210         */ 
    235211        public static function alpha_numeric($str, $utf8 = FALSE) 
     
    241217 
    242218        /** 
    243          * Method: alpha_dash 
    244          *  Checks whether a string consists of alphabetical characters, numbers, underscores and dashes only 
    245          * 
    246          * Parameters: 
    247          *  str  - input string 
    248          *  utf8 - trigger UTF-8 compatibility 
    249          * 
    250          * Returns: 
    251          *  TRUE if string only contains alphabetical characters, numbers, underscores and dashes; FALSE if not. 
     219         * Checks whether a string consists of alphabetical characters, numbers, underscores and dashes only. 
     220         * 
     221         * @param   string   input string 
     222         * @param   boolean  trigger UTF-8 compatibility 
     223         * @return  boolean 
    252224         */ 
    253225        public static function alpha_dash($str, $utf8 = FALSE) 
     
    259231 
    260232        /** 
    261          * Method: digit 
    262          *  Checks whether a string consists of digits only (no dots or dashes) 
    263          * 
    264          * Parameters: 
    265          *  str  - input string 
    266          *  utf8 - trigger UTF-8 compatibility 
    267          * 
    268          * Returns: 
    269          *  TRUE if string only contains digits, FALSE if not. 
     233         * Checks whether a string consists of digits only (no dots or dashes). 
     234         * 
     235         * @param   string   input string 
     236         * @param   boolean  trigger UTF-8 compatibility 
     237         * @return  boolean 
    270238         */ 
    271239        public static function digit($str, $utf8 = FALSE) 
     
    277245 
    278246        /** 
    279          * Method: numeric 
    280          *  Checks whether a string is a valid number (negative and decimal numbers allowed) 
    281          * 
    282          * Parameters: 
    283          *  str  - input string 
    284          * 
    285          * Returns: 
    286          *  TRUE if string is a valid number, FALSE if not. 
     247         * Checks whether a string is a valid number (negative and decimal numbers allowed). 
     248         * 
     249         * @param   string   input string 
     250         * @return  boolean 
    287251         */ 
    288252        public static function numeric($str) 
     
    292256 
    293257        /** 
    294          * Method: numeric 
    295          *  Checks whether a string is a valid text 
    296          * 
    297          * Parameters: 
    298          *  str  - input string 
    299          * 
    300          * Returns: 
    301          *  TRUE if string is a valid text, FALSE if not. 
     258         * Checks whether a string is a valid text. 
     259         * 
     260         * @param   string   $str 
     261         * @return  boolean 
    302262         */ 
    303263        public static function standard_text($str)