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.