Actually its very easy to add a css class to a GUI component. Assume you have the button object, all you need to do is to add one line of script:
PHP Code:
$button->setClass("btn btn-primary");
And its done. Of course since in most of the time the button object is instantiated and added directly to the form container object, you may need to modify 2-3 lines rather than just 1 line. Heres an example, you will need to change this:
PHP Code:
$form->add(new Button("Click to Submit", "submit", "submit"));
to the three lines script below:
PHP Code:
$submitButton = new Button("Click to Submit", "submit", "submit");
$submitButton->setClass("btn btn-primary");
$form->add($submitButton);
Still, its pretty easy in my eyes. Of course for users who lack php or OOP experience it can be a bit tricky. XD