Skip to content

Instantly share code, notes, and snippets.

@colinmollenhour
Created April 19, 2009 19:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save colinmollenhour/98178 to your computer and use it in GitHub Desktop.
Save colinmollenhour/98178 to your computer and use it in GitHub Desktop.
class Kohana extends Kohana_Core {
// Se the active component in the Router
public static $component;
/**
* A wrapper for Kohana::find_file, this is to be used where the component path should be searched first
*/
public static function find_file($directory, $filename, $required = FALSE, $ext = FALSE)
{
$file = FALSE;
if(self::$component)
{
$file = parent::find_file(self::$component.'/'.$directory, $filename, FALSE, $ext);
}
if( ! $file)
{
$file = parent::find_file($directory, $filename, $required, $ext);
}
return $file;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment