Skip to content


Subversion checkout URL

You can clone with
Download ZIP


registerScriptFile with custom htmlOptions. #1761

metayii opened this Issue · 2 comments

2 participants


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="" 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:


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


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.