public static function checkNext($view) { $name = array(); preg_match('/@extends.+?\\)/', $view, $name); if (!$name) { return false; } $name = trim(str_replace(array('@extends', '(', ')', '"', '\''), '', $name[0])); $path = Ant::settings('view') . DIRECTORY_SEPARATOR . Helper::realPath($name) . '.' . Ant::settings('extension'); if (false == file_exists($path)) { throw new Exception(sprintf('Template file not found at %s', $path)); } $io = IO::init()->in($path); $nextview = $io->get(); $io->out(); return array('path' => $path, 'view' => $nextview); }