-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
v3 Form Group actions classes #97
Comments
Assuming that this code works, I'd turn it into this: $rowPlugin->getElement()->spawnChild()->addClass('col-sm-offset-2 col-sm-8')->setContent($content); |
But how to let user custom the classes? $rowPlugin->getElement()->spawnChild()->addClass($userCustomClass)->setContent($content); |
You wouldn't. I think I've told you this before but... This file is a convenience file. It makes rendering a row easier. You're returning the object so you could have them, or us, set it afterwards, like: // In Row.php
$rowPlugin->getElement()->spawnChild()->addClass('col-sm-offset-2 col-sm-8')->setContent($content);
// In wherever you're using Row
$rowPlugin = $rowHelper->renderActionsRow($actions);
$rowPlugin->getChildren()[0]->addClass('my awesome classes'); Otherwise just allow them to supply classes with the second argument. |
From the Row ok, but from the form Helper? echo $this->sxbForm($form, true)->horizontal(); // How to set the action class and automatically render the form?
|
Then you shouldn't use the Form helper. If you want to do custom stuff, you have to write custom code. We can't make everyone happy with extremely specific implementations I'm afraid. The best I can come up with is adding another method to Form, so you can chain. Examples: echo $this->sxbForm($form, true)->horizontal()->setActionElementClass('my cool classes');
echo $this->sxbForm($form, true)->horizontal()->getActionElement()->getChildren()[0]->addClass('my cool classes'); |
@RWOverdijk i need your help
Could you help me to implement properly this:
https://github.com/SpoonX/SxBootstrap/blob/3.0.0/src/SxBootstrap/View/Helper/Bootstrap/Form/Row.php#L79
User could set the action class, but i don't know how
we could add a property that by default has the value "col-sm-offset-2 col-sm-8" that is sufficient for the genral use.
But we have to let user change this property.
The text was updated successfully, but these errors were encountered: