Checkbox label on the left

Notice: This thread is very old.
Droid
Member | 92
+
0
-

Hi, is there any clean way how to move my checkbox label to the left column (where the all label elements are)? Thanks for any advices.

HosipLan
Moderator | 4668
+
0
-

Yes, render template “by hand”, in Latte.

mm-marek
Member | 61
+
0
-

basic example is inside Nette package ⇒ /examples/forms/manual-rendering.php

duke
Member | 650
+
0
-

You may also create your own form renderer, e.g. by extending the default one, i.e. Nette\Forms\Rendering\DefaultFormRenderer. In your case, it should be sufficient to override its methods renderLabel and renderControl. Then simply assign your renderer to the form through $form->setRenderer($myRenderer).

22
Member | 1478
+
0
-

Just the easy trick:

... //checkbox definition
->getLabelPrototype()->class('float-left');
.float-left{
	float: left;
}

or so.. I think only css can solve that problem.

Last edited by 22 (2011-11-22 04:21)

Nox
Member | 378
+
0
-

But choose a name different from .float-left – the identitier should name the purpose, not implementation + you'd be putting almost-CSS into the PHP form definition code