file path fallback for js

This commit is contained in:
Claude 2013-04-18 14:19:32 +02:00
parent 3ea24dbb92
commit 8199fe847b

View File

@ -75,6 +75,13 @@ class Theme_assets extends CI_Controller
//file path
$file_path = 'themes/' . $this->theme . '/js/' . $js_file;
//fallback to default js if js in theme not found
if (!file_exists($file_path))
{
$file_path = 'themes/default/js/' . $js_file;
}
//send
header('Content-Type: application/x-javascript; charset=utf-8');
$this->_expires_header(30);