Changeset 2152

Show
Ignore:
Timestamp:
02/23/2008 12:56:52 AM (8 months ago)
Author:
armen
Message:

Canged the Kohana::find_file call syntax due to r2135.
you can use Kohana::find_file for non-PHP extensions like following example:

Kohana::find_file('directory', 'filename', FALSE, 'css');

which the last arg is custom file type.

Location:
trunk/system
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/system/core/Kohana.php

    r2143 r2152  
    706706                { 
    707707                        // Users can define their own extensions, .css, etc 
    708                         $ext = ($ext == FALSE) ? EXT : $ext; 
     708                        $ext = ($ext == FALSE) ? ltrim(EXT, '.') : $ext; 
    709709 
    710710                        // Find the file and return its filename 
    711711                        foreach (Config::include_paths() as $path) 
    712712                        { 
    713                                 if (is_file($path.$search.$ext)) 
    714                                         return $found[$hash] = $path.$search.$ext; 
     713                                if (is_file($path.$search.'.'.$ext)) 
     714                                        return $found[$hash] = $path.$search.'.'.$ext; 
    715715                        } 
    716716 
  • trunk/system/libraries/View.php

    r2139 r2152  
    5757 
    5858                        // Load the filename and set the content type 
    59                         $this->kohana_filename = Kohana::find_file('views', $name.'.'.$type, TRUE, $type); 
     59                        $this->kohana_filename = Kohana::find_file('views', $name, TRUE, $type); 
    6060                        $this->kohana_filetype = Config::item('mimes.'.$type); 
    6161                        $this->kohana_filetype = empty($this->kohana_filetype) ? $type : $this->kohana_filetype;