Changeset 3012

Show
Ignore:
Timestamp:
07/09/2008 05:55:59 AM (3 months ago)
Author:
dlib
Message:

added Router::$controller_dir, if you access '/controller_name' it will contain , if you access /sub_dir/controller_name' it will contain 'sub_dir'

Files:
1 modified

Legend:

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

    r2936 r3012  
    2424        public static $controller; 
    2525        public static $controller_path; 
    26  
     26        public static $controller_dir; 
     27         
    2728        public static $method    = 'index'; 
    2829        public static $arguments = array(); 
     
    108109                                        if (is_file($dir.$controller_path.EXT)) 
    109110                                        { 
     111                                                //Set controller subdirectory if any 
     112                                                self::$controller_dir=substr($controller_path,0,strrpos($controller_path,'/'));  
     113                                                                                                 
    110114                                                // Set controller name 
    111115                                                self::$controller = $segment;