bstrahija / assets-ci

Simple assets library for CodeIgniter. Ability to combine, minify and use the Less syntax.
http://creolab.hr
112 stars 31 forks source link

Enable dynamic URLs in link/script tags #22

Closed RelativeMedia closed 12 years ago

RelativeMedia commented 12 years ago

I use SSL a lot on my apps and it'd be great if you could either provide a flag to use // instead of http:// or a flag to force SSL on all.

<script type="text/javascript" src="//maps.googleapis.com/maps/api/js?sensor=false&amp;callback=init"></script>
RelativeMedia commented 12 years ago

This would apply to stylesheets as well..

bstrahija commented 12 years ago

There's a file in the config folder called "assets_cdn.php", you can define your CDN paths there.

I also added the option base_url in the config so you can have a different URL for your assets. If you leave it at null, the default CI value is used.

Please test this.

RelativeMedia commented 12 years ago

so you use base_url() to compile the src="" links of local js/css files then?, in which case if i define

$config['base_url'] = 'https://example.com';

then the js/css tags will use that url?

bstrahija commented 12 years ago

By default the CI setting will be used for base_url, but you can override this in the assets config file.

RelativeMedia commented 12 years ago

Awesome! You da' man! I'd like to submit a bit of update to the docs about this... might provide some clarification for others. Ill fork and have a pull request on branch/develop