Skip to content
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

Cannot add attributes to Checkbox #126

Open
jrslv opened this issue Jul 13, 2016 · 1 comment
Open

Cannot add attributes to Checkbox #126

jrslv opened this issue Jul 13, 2016 · 1 comment

Comments

@jrslv
Copy link

jrslv commented Jul 13, 2016

It is currently not possible to add HTML attributes to checkboxes using {input foo, 'class' => 'bar'} Latte macro. The reason is getControl method of Checkbox returns a wrapper HTML object instead of the input itself.

Rewriting getControl method to

public function getControl()
{
    $this->wrapper = $this->getLabelPart()->insert(0, $this->getControlPart());
    return $this->wrapper;
}

at least fixes the ability to add attributes to the wrapper element (maybe this is disabled on purpose to avoid confusion). But anyway adding attributes to checkbox input elements is not currently possible.

@dg
Copy link
Member

dg commented Jun 21, 2017

Better way is to use <input n:name=foo class=bar>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants