Show
Ignore:
Timestamp:
12/06/2007 08:15:37 PM (12 months ago)
Author:
Shadowhand
Message:

Changes to core:

  • date::timestamp() variable name typo
  • form::input() no longer puts an id on array-keyed inputs
  • form::label() no longer
  • added arr::unshift_assoc()
  • replace a couple of internal find_all() calls with load_result(TRUE) to avoid an extra method call
  • fixed a bug in Mysql_Result::result_array() that made multiple calls fail after the first call do to the pointer not being reset
  • small code and comment cleanups
Files:
1 modified

Legend:

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

    r1333 r1437  
    2424         *  The transformed array 
    2525         */ 
    26         function rotate($source_array, $keep_keys = TRUE) 
     26        public function rotate($source_array, $keep_keys = TRUE) 
    2727        { 
    2828                $new_array = array(); 
     
    5050         *  The value of the requested array key 
    5151         */ 
    52         function remove($key, & $array) 
     52        public function remove($key, & $array) 
    5353        { 
    5454                if ( ! isset($array[$key])) 
     
    6060                return $val; 
    6161        } 
    62 } 
     62 
     63        /** 
     64         * Because PHP does not have this function. 
     65         * 
     66         * @param   array   array to unshift 
     67         * @param   string  key to unshift 
     68         * @param   mixed   value to unshift 
     69         * @return  array 
     70         */ 
     71        public function unshift_assoc( array & $array, $key, $val) 
     72        { 
     73                $array = array_reverse($array, TRUE); 
     74                $array[$key] = $val; 
     75                $array = array_reverse($array, TRUE); 
     76 
     77                return $array; 
     78        } 
     79 
     80} // End arr