Jump to content

Secondary buttons in a form


Recommended Posts

Can't you just set the class ?

$button = wire('modules')->get('InputfieldButton');
$button->attr('class', 'ui-button ui-widget ui-state-default ui-corner-all align-me-right'); 
 
Didn't test it but looks like: $button->addClass('align-right'); should do the trick.
Edited by Martijn Geerts
  • Like 2
Link to comment
Share on other sites

It is built in. Martijn was close right. You can do this:

$button = $this->modules->get('InputfieldButton'); 
$button->attr('id', 'button_create'); 
$button->attr('value', $this->_('Create New')); 
$button->attr('href', './edit/'); 
$button->class .= ' my-float-right-class';//note: concatenation + space

PW will add the other inbuilt button classes.

//See a cleaner alternative below...

Edited by kongondo
  • Like 2
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...