Best Practice for Extension Structure

So, I was sitting down to make an extension to use the chosen jquery plugin to make form selects much mo’ prettier. At first I thought I would need to mess with the html output, but after looking at it, I realize it is really just some jquery calls and script registrations.

Given that this is the case, is it still appropriate to wrap these things up in a widget? I have it now where the code to make all of your pulldowns of class "something" look sharp is like so:


<?php

 	$this->widget('ext.chosenDropDowns.ChosenDropDowns',

 		array(

 			'selector' => ".something",

 		)

 	);

?>

But I am wondering if a widget is the wrong thing. Should I instead just use a static class so that the call looks more like this:


<?php

 	ChosenDropDowns::MakeDropDownsAwesome(

		array(

			'selector' => '.something',

		)

	);

?>

I’m not asking for help with the functionality, but asking if it makes more sense for the asset publishing and script registering to be done as a widget (example one) or a helper (example 2) from a best practices standpoint.

Why did you put widget into extensions? I mean it will works, but I would rather put it under components/widget folder.

There are no clear answer in this case(for), but I would just rather go with first option.

Ha! I should have been more clear – I’m going to upload this as an extension to the yii site. I did not mean to say it was in my extensions folder!

I just want to make the API the most sensible before I upload