diff --git a/application/config/autoload.php b/application/config/autoload.php index 0da0117..12e19aa 100755 --- a/application/config/autoload.php +++ b/application/config/autoload.php @@ -89,7 +89,7 @@ $autoload['drivers'] = array(); | | $autoload['helper'] = array('url', 'file'); */ -$autoload['helper'] = array('vertical'); +$autoload['helper'] = array('vertical', 'asset'); /* | ------------------------------------------------------------------- diff --git a/application/helpers/asset_helper.php b/application/helpers/asset_helper.php new file mode 100644 index 0000000..25b293f --- /dev/null +++ b/application/helpers/asset_helper.php @@ -0,0 +1,47 @@ + appended. + * + * Only for files inside the webroot. Remote assets (Google Fonts, the + * cookieyes script, momentjs) must keep their own URLs untouched. + * + * Falls back to the plain URL when the file is missing, so a bad path + * degrades to the previous behaviour rather than emitting a warning. + * + * @param string $path webroot-relative, e.g. 'assets/css/main.css' + * @return string + */ + function asset_ver($path) + { + $path = ltrim((string) $path, '/'); + $url = rtrim(SITEURL, '/').'/'.$path; + + $file = FCPATH.$path; + + if ($path !== '' && is_file($file)) + { + $url .= (strpos($url, '?') === FALSE ? '?' : '&').'v='.filemtime($file); + } + + return $url; + } +} diff --git a/application/views/includes/barber-head.php b/application/views/includes/barber-head.php index 2ed6678..336088d 100755 --- a/application/views/includes/barber-head.php +++ b/application/views/includes/barber-head.php @@ -32,17 +32,17 @@ $this->load->helper('url'); - - + + - - - + + + - - - + + + \ No newline at end of file diff --git a/application/views/includes/barber-skeleton-bottom.php b/application/views/includes/barber-skeleton-bottom.php index 4c823f1..b51897c 100755 --- a/application/views/includes/barber-skeleton-bottom.php +++ b/application/views/includes/barber-skeleton-bottom.php @@ -5,10 +5,10 @@ - - - - - + + + + + diff --git a/application/views/includes/beauty-head.php b/application/views/includes/beauty-head.php index 4a1920e..8745c16 100755 --- a/application/views/includes/beauty-head.php +++ b/application/views/includes/beauty-head.php @@ -31,20 +31,20 @@ $this->load->helper('url'); - + - - + + - - + + - - - + + + - - - - + + + + + diff --git a/application/views/includes/head.php b/application/views/includes/head.php index 1af4b14..104faf5 100755 --- a/application/views/includes/head.php +++ b/application/views/includes/head.php @@ -31,21 +31,21 @@ $this->load->helper('url'); - - + + - + - + - - - - - + + + + + - - - - - + + + + + + diff --git a/application/views/includes/vertical-head.php b/application/views/includes/vertical-head.php index 665db75..b8c6ac9 100644 --- a/application/views/includes/vertical-head.php +++ b/application/views/includes/vertical-head.php @@ -34,17 +34,17 @@ $this->load->helper('url'); - + - - + + - - + + - - - + + + diff --git a/application/views/includes/vertical-skeleton-bottom.php b/application/views/includes/vertical-skeleton-bottom.php index 1472753..3b33c40 100644 --- a/application/views/includes/vertical-skeleton-bottom.php +++ b/application/views/includes/vertical-skeleton-bottom.php @@ -6,10 +6,10 @@ - - - - - + + + + +