Changeset 412

Show
Ignore:
Timestamp:
08/26/2007 02:43:57 PM (14 months ago)
Author:
Shadowhand
Message:

Added the start of the Database library and config file

Location:
branches/devel
Files:
2 added
5 modified

Legend:

Unmodified
Added
Removed
  • branches/devel/application/config/routes.php

    r397 r412  
    22 
    33$config['_default'] = 'user_guide/kohana'; 
     4// $config['_default'] = 'welcome'; 
  • branches/devel/application/controllers/welcome.php

    r409 r412  
    55        function index() 
    66        { 
    7                 print new View('welcome', array('message' => 'testing calls back to the controller')); 
    8                  
    9                 // $db = new Database(); 
    10                 // print_r ($db); 
    11         } 
    12  
    13         function say_hello() 
    14         { 
    15                 return '<strong>OMG HI!!!!1</strong>'; 
     7                $db = new Database(); 
     8                print_r ($db); 
    169        } 
    1710 
  • branches/devel/application/views/welcome.php

    r411 r412  
    11<h2><?php echo $message ?></h2> 
     2<p><?= $this->say_hello() ?></p> 
    23<hr/> 
  • branches/devel/system/core/Bootstrap.php

    r397 r412  
    5757         */ 
    5858        $controller = Kohana::instance(); 
    59          
     59 
    6060        if (method_exists($controller, '_remap')) 
    6161        { 
     
    9696        // Run system.post_controller 
    9797        Event::run('system.post_controller'); 
     98 
     99        // Make sure that $controller is not available globally 
     100        unset($controller); 
    98101} 
    99102catch (controller_not_found $exception) 
  • branches/devel/system/libraries/URI.php

    r407 r412  
    22 
    33class URI_Core extends Router { 
    4          
     4 
    55        public function segment($index = 1) 
    66        { 
    77                $index = (int) $index - 1; 
    8                  
     8 
    99                return isset(self::$segments[$index]) ? self::$segments[$index] : FALSE; 
    1010        } 
     
    1919                        $segment_array[$i++] = $segment; 
    2020                } 
    21                  
     21 
    2222                return $segment_array; 
    2323        } 
    24          
     24 
    2525        public function string() 
    2626        { 
    2727                return implode('/', self::$segments); 
    2828        } 
    29          
     29 
    3030} // End URI Class