Show
Ignore:
Timestamp:
11/11/2007 12:59:10 AM (13 months ago)
Author:
Shadowhand
Message:

Small changes:

  • Hooks are now loaded *after* system events have been added
  • Hook loading changed to use Kohana::list_files(), rather than manually finding them (DRY!)
  • Kohana::auto_load() now uses require_once() instead of require(), to prevent duplicate file loads that will cause E_FATAL errors
  • Kohana::auto_load() will no longer try to auto-extend classes that end with _Core (eg: "class Special_Router extends Router_Core {}" will no longer try to auto-load "Router_Core_Core")
  • Kohana::key_string() will handle numerically indexed key strings now (thanks Armen!)
  • Added Event::add_before() and Event::add_after(), to add events before and after a given event, and supporting private function Event::insert_event()
  • Cleaned up Event::add() to use empty() instead of == FALSE
  • View::construct() uses array_merge($this->data, $data) instead of doing a foreach($data) (Duh!)
  • View::set() will now handle an associative array (Duh!)
  • Router::setup() split into Router::find_uri() and Router::setup(), for better Event extensibility
  • Cleaned up Router::setup() to use self::$current_uri instead of self::$segments as the default URI location

Phew!

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/system/libraries/View.php

    r1016 r1084  
    4545                if (is_array($data) AND ! empty($data)) 
    4646                { 
    47                         foreach($data as $name => $value) 
    48                         { 
    49                                 $this->data[$name] = $value; 
    50                         } 
     47                        $this->data = $data; 
    5148                } 
    5249 
     
    6562         *  View object 
    6663         */ 
    67         public function set($name, $value) 
     64        public function set($name, $value = NULL) 
    6865        { 
    69                 $this->__set($name, $value); 
     66                if (func_num_args() === 1 AND is_array($name)) 
     67                { 
     68                        foreach($name as $key => $value) 
     69                        { 
     70                                $this->__set($key, $value); 
     71                        } 
     72                } 
     73                else 
     74                { 
     75                        $this->__set($name, $value); 
     76                } 
    7077                return $this; 
    7178        }