View Single Post
  #2  
Old 01-29-2014, 11:48 AM
Hall of Famer's Avatar
Hall of Famer Hall of Famer is offline
Administrator, Lead Coder
 
Join Date: Dec 2008
Location: South Brunswick
Posts: 4,448
Gender: Male
Credits: 332,921
Hall of Famer is on a distinguished road
Default

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
__________________


Mysidia Adoptables, a free and ever-improving script for aspiring adoptables/pets site.
Reply With Quote