Xoops Development::set class for form elements
\XoopsFormRendererInterface defines the interaction between the business logic supplied by form elements and the presentation layer rendering of those elements. All HTML generated by core form and form element classes is done by an implementation of \XoopsFormRendererInterface.
\XoopsFormRendererBootstrap3 is a component supplied with core that provides a concrete implementation of \XoopsFormRendererInterface. A theme may optionally use that component. If the theme does not explicitly specify an implementation of \XoopsFormRendererInterface to use, the rendering choice will default to \XoopsFormRendererLegacy, which closely mimics the HTML generated in pre-2.5.9 form elements.
The separation through the interface makes the HTML generation the responsibility of the presentation layer, more specifically the theme. New and different renders are possible and expected, even for frameworks that have not been written yet.
To complete the separation, we need to stop passing the presentation detail directly from the business logic. This kind of detail belongs in the template where it can be adjusted by theme.
\XoopsFormRendererInterface defines the interaction between the business logic supplied by form elements and the presentation layer rendering of those elements. All HTML generated by core form and form element classes is done by an implementation of \XoopsFormRendererInterface.
\XoopsFormRendererBootstrap3 is a component supplied with core that provides a concrete implementation of \XoopsFormRendererInterface. A theme may optionally use that component. If the theme does not explicitly specify an implementation of \XoopsFormRendererInterface to use, the rendering choice will default to \XoopsFormRendererLegacy, which closely mimics the HTML generated in pre-2.5.9 form elements.
The separation through the interface makes the HTML generation the responsibility of the presentation layer, more specifically the theme. New and different renders are possible and expected, even for frameworks that have not been written yet.
To complete the separation, we need to stop passing the presentation detail directly from the business logic. This kind of detail belongs in the template where it can be adjusted by theme.
$( document ).ready(function() {
$('#myspecialbutton').addClass('btn-success').removeClass('btn-default');
});