* @see
* http://www.yiiframework.com/doc/api/1.1/CController#resolveViewFile-detail
* @return file if file exists, otherwise null.
*/
public static FileObject getAbsoluteViewFile(String targetPath, FileObject currentFile) {
PhpModule phpModule = PhpModule.Factory.forFileObject(currentFile);
YiiModule yiiModule = YiiModuleFactory.create(phpModule);
// get absolute view within the application
if (targetPath.startsWith(APP_PATH_PREFIX)) { // NOI18N
targetPath = targetPath.replaceFirst(MODULE_PATH_PREFIX, ""); // NOI18N
targetPath = String.format(VIEW_PATH_FORMAT, targetPath);