Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

registerScriptFile with custom htmlOptions. #1761

Closed
metayii opened this Issue · 2 comments

2 participants

@metayii

Hi. I'm trying to create a widget encapsulating the new Dropbox Chooser API, which need to be included with a tag like this one:

<script type="text/javascript" src="https://www.dropbox.com/static/api/1/dropbox.js" id="dropboxjs" data-app-key="YOUR_APP_KEY"></script>

As you can see, there's a non standard attribute data-app-key in it. So, this Javascript library can not be inserted using registerScriptFile, since the render generates a fixed script tag. Of course I can just drop a CHtml::tag('script' blahblah) but this can not be included at the head section of the page and there's no way to control if you already included a library in case the widget is used elsewhere in the page (of course I could use a singleton or something else, but it would be cumbersome).

So, something like this would be useful:

public CClientScript registerScriptFile(string $url, integer $position=NULL, $htmlOptions=NULL)

Please take it in consideration.

Discussion here: http://www.yiiframework.com/forum/index.php/topic/37972-registerscriptfile-with-custom-htmloptions/

@metayii

Two classes with modifications needed for this feature have been posted in the forum's thread. They might be a start.

@resurtm
Collaborator

Duplicate of: #1724
Already fixed in: #2172

@resurtm resurtm closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.