Created
January 3, 2013 11:57
-
-
Save anonymous/4442970 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static function getPathOfAlias($alias) | |
{ | |
if(isset(self::$_aliases[$alias])) | |
return self::$_aliases[$alias]; | |
else if(($pos=strpos($alias,'.'))!==false) | |
{ | |
$rootAlias=substr($alias,0,$pos); | |
if(isset(self::$_aliases[$rootAlias])) | |
return self::$_aliases[$alias]=rtrim(self::$_aliases[$rootAlias].DIRECTORY_SEPARATOR.str_replace('.',DIRECTORY_SEPARATOR,substr($alias,$pos+1)),'*'.DIRECTORY_SEPARATOR); | |
else if(self::$_app instanceof CWebApplication) | |
{ | |
if(self::$_app->findModule($rootAlias)!==null) | |
return self::getPathOfAlias($alias); | |
} | |
} | |
return false; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment