zf2-assetic-module icon indicating copy to clipboard operation
zf2-assetic-module copied to clipboard

Attach external assets

Open sparrowek opened this issue 10 years ago • 3 comments

I have a certain problem - I would like to attach an external asset that cannot be stored locally (i.e. cached on disc) e.g. google maps API which checks internally if it is loaded from google site.

In other words I cannot make an asset like this:

'route_name => array(
   '@google_maps_js',
),

I can of course add it normally using view helper in an phtml file - as if I was not using an asset manager at all but an idea come to me why not make an entry like that:

'route_name => array(
   'http://google/api.js,
),

that is without a "@" mark in front to have an asset not stored locally but only used by a ViewHelperStrategy to inject into the page. Other solution would be to have an option for a normal asset (with @) that forces an asset to always load externally?

sparrowek avatar Mar 25 '14 16:03 sparrowek

+1

jarrettj avatar Jun 05 '18 08:06 jarrettj

Hi @sparrowek,

I made small style adjustment, to make the issue description more readable, I hope you don't mind it.

I like your idea of including remote assets by simply declaring absolute URL schema 👍

'route_name => array(
   'http://google/api.js,
),

I will gladly accept your PR, that brings this feature to this project. Short guideline on contribution to this project, you can find here: https://github.com/widmogrod/zf2-assetic-module/blob/master/CONTRIBUTING.md

widmogrod avatar Jun 06 '18 21:06 widmogrod

For now // works and I'm cool with that :)

jarrettj avatar Jun 07 '18 06:06 jarrettj