Changeset 678
- Timestamp:
- 10/06/2007 08:19:56 PM (14 months ago)
- Location:
- trunk/system
- Files:
-
- 4 modified
-
core/Kohana.php (modified) (3 diffs)
-
helpers/html.php (modified) (5 diffs)
-
libraries/Router.php (modified) (1 diff)
-
libraries/View.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/system/core/Kohana.php
r675 r678 198 198 if (self::$instance == FALSE) 199 199 { 200 // Include the Controller file 201 require Router::$directory.Router::$controller.EXT; 202 200 203 // Run system.pre_controller 201 204 Event::run('system.pre_controller'); 202 205 203 // Include the Controller file204 require Router::$directory.Router::$controller.EXT;205 206 206 // Set controller class name 207 207 $controller = ucfirst(Router::$controller).'_Controller'; 208 208 209 try 210 { 211 // Load the controller 212 $controller = new $controller(); 213 } 214 catch (Kohana_Exception $exception) 215 { 216 Kohana::show_404(); 217 return; 218 } 209 // Load the controller 210 $controller = new $controller(); 219 211 220 212 if (method_exists($controller, '_remap')) … … 244 236 else 245 237 { 246 $controller->show_404(); 247 } 248 if (count(Router::$arguments) > 0) 238 Kohana::show_404(); 239 } 240 241 if (is_array(Router::$arguments) AND ! empty(Router::$arguments)) 249 242 { 250 243 call_user_func_array(array(Kohana::instance(), Router::$method), Router::$arguments); … … 254 247 call_user_func(array(Kohana::instance(), Router::$method)); 255 248 } 249 256 250 257 251 // Run system.pre_controller -
trunk/system/helpers/html.php
r644 r678 144 144 } 145 145 146 public static function stylesheet($style, $ index = FALSE, $media = FALSE)146 public static function stylesheet($style, $media = FALSE) 147 147 { 148 148 $compiled = ''; … … 152 152 foreach($style as $name) 153 153 { 154 $compiled .= self::stylesheet($name, $ index, $media)."\n";154 $compiled .= self::stylesheet($name, $media)."\n"; 155 155 } 156 156 } … … 159 159 $media = ($media == FALSE) ? '' : ' media="'.$media.'"'; 160 160 161 $compiled = '<link rel="stylesheet" href="'.url::base( $index).$style.'.css"'.$media.' />';161 $compiled = '<link rel="stylesheet" href="'.url::base(TRUE).$style.'.css"'.$media.' />'; 162 162 } 163 163 … … 173 173 * @return string 174 174 */ 175 public static function script($script , $index = FALSE)175 public static function script($script) 176 176 { 177 177 $compiled = ''; … … 186 186 else 187 187 { 188 $compiled = '<script type="text/javascript" src="'.url::base( $index).$script.'.js"></script>';188 $compiled = '<script type="text/javascript" src="'.url::base(TRUE).$script.'.js"></script>'; 189 189 } 190 190 -
trunk/system/libraries/Router.php
r644 r678 197 197 self::$controller = self::$rsegments[0]; 198 198 self::$method = isset(self::$rsegments[1]) ? self::$rsegments[1] : 'index'; 199 self::$arguments = isset(self::$rsegments[2]) ? array_slice(self::$rsegments, 2) : array(); 199 200 } 200 201 else -
trunk/system/libraries/View.php
r673 r678 90 90 } 91 91 92 public function &__get($name)92 public function __get($name) 93 93 { 94 if (isset($this->data)) 95 return $this->data; 96 97 return FALSE; 94 return empty($this->data[$name]) ? NULL : $this->data[$name]; 98 95 } 99 96
