# |
Feb 13th 2020, 16:07 |
sebastian.krzewinski. |
and create new login place |
# |
Feb 13th 2020, 16:06 |
sebastian.krzewinski. |
how to allow home and pages to not auth? |
# |
Feb 13th 2020, 15:49 |
alexmax |
Yeah this really does seem like it's forgotten about, because taking a closer look at the generated HTML for the checkboxes, not only am I seeing no labels, but I'm seeing all of the options crammed into an `options` attribute in the input tag, which isn't even wrong. |
# |
Feb 13th 2020, 15:48 |
alexmax |
so I can create an issue out of it. |
# |
Feb 13th 2020, 15:47 |
alexmax |
Maybe I'll spend a little time and crank out a minimal reproduction when I have a moment. |
# |
Feb 13th 2020, 15:46 |
alexmax |
Seems to me that either there should be a default template for `checkboxContainer` or `multiple => checkbox` should do something different than what it's doing now, and I'm not sure which is the correct play. |
# |
Feb 13th 2020, 15:46 |
alexmax |
Well I'm not sure what the correct behavior is here. I was just pointing it because it might be some corner case functionality that was forgotten about, and maybe these tests can be changed to something else that is the intended behavior. |
# |
Feb 13th 2020, 15:45 |
noel |
If it's in the test suite then maybe you can just copy it from there and do a PR? |
# |
Feb 13th 2020, 15:44 |
alexmax |
Strangely enough, the only time I can find this template by name is in the test suite |
# |
Feb 13th 2020, 15:44 |
alexmax |
https://github.com/cakephp/cakephp/search?q=checkboxContainerandunscoped_q=checkboxContainer |
# |
Feb 13th 2020, 15:43 |
alexmax |
Wonder if that version has the same problem. |
# |
Feb 13th 2020, 15:43 |
alexmax |
We're in the process of upgrading to 3.8 anyway |
# |
Feb 13th 2020, 15:43 |
noel |
@sebastian.krzewinski. depends on whether you're using cakePHP 3.8 or 4. |
# |
Feb 13th 2020, 15:42 |
alexmax |
Yeah but again, 3.5, old version, probably not supported, yada yada yada |
# |
Feb 13th 2020, 15:42 |
noel |
@alexmax It does sound broken to me. Sounds like the code was designed to look for a container when you specify `multiple` but that wasn't implemented for checkbox. |
# |
Feb 13th 2020, 15:41 |
sebastian.krzewinski. |
better use book from cake 3.8 then 4? |
# |
Feb 13th 2020, 15:41 |
neon1024 |
https://book.cakephp.org/3/en/views/helpers/form.html#customizing-the-templates-formhelper-uses |
# |
Feb 13th 2020, 15:40 |
alexmax |
Yeah I found it very odd that it was looking for a template that literally did not exist (or at least I couldn't find) |
# |
Feb 13th 2020, 15:40 |
neon1024 |
I tend to do this if I need to change the odd field in a single form. If I need it elsewhere I make a templates file |
# |
Feb 13th 2020, 15:40 |
neon1024 |
You can use `$this->Form->setConfig('templates.checkbox', $myNewTemplate)` |
# |
Feb 13th 2020, 15:39 |
neon1024 |
I tend to replace this https://github.com/cakephp/cakephp/blob/3.5.18/src/View/Helper/FormHelper.php#L106 |
# |
Feb 13th 2020, 15:39 |
alexmax |
Cake 3.5 btw |
# |
Feb 13th 2020, 15:38 |
alexmax |
Without one, I get an error message saying it can't find a template for `checkboxContainer`. Should there be one? |
# |
Feb 13th 2020, 15:37 |
neon1024 |
@alexmax Are you giving a custom template string to the Form->setTemplate ? |
# |
Feb 13th 2020, 15:36 |
alexmax |
when you want "at least one of these checkboxes" |
# |
Feb 13th 2020, 15:35 |
alexmax |
Man I hope I don't have to resort to three separate fields again, validation and error rendering on those is a pain in the neck |
# |
Feb 13th 2020, 15:35 |
sebastian.krzewinski. |
i dont get.. do all with docs.. not work.. add 1 line and everything fine |
# |
Feb 13th 2020, 15:35 |
alexmax |
Hrm, even when I supply a basic template for `checkboxContainer` the resulting HTML is lacking - the checkboxes are missing labels. |
# |
Feb 13th 2020, 15:33 |
dereuromark |
true :) ignore deprecations |
# |
Feb 13th 2020, 15:32 |
spriz |
AuthComponent is also still working all good :v: |
# |
Feb 13th 2020, 15:31 |
dereuromark |
good old days where you used TinyAuth and 3 lines of config and all worked fine. |
# |
Feb 13th 2020, 15:30 |
sebastian.krzewinski. |
im done for today.. this docs not working (auth) |
# |
Feb 13th 2020, 15:27 |
spriz |
I like the first one better, and that was the one I have used the most but I've been confused since the 2nd was added :shrug: |
# |
Feb 13th 2020, 15:27 |
neon1024 |
Seriously @spriz No idea! :thinking_face: Probably the first option? It’s readable |
# |
Feb 13th 2020, 15:26 |
dereuromark |
darn, he was faster |
# |
Feb 13th 2020, 15:26 |
dereuromark |
actually, make it a separate class and inject it. |
# |
Feb 13th 2020, 15:26 |
neon1024 |
Injected via DI container |
# |
Feb 13th 2020, 15:26 |
neon1024 |
Wrap it in a private method too |
# |
Feb 13th 2020, 15:26 |
neon1024 |
So I pick option 2 |
# |
Feb 13th 2020, 15:25 |
neon1024 |
More code means you’re working harder, so you get paid more :pokerface: |
# |
Feb 13th 2020, 15:25 |
spriz |
Which one do you use - why? :) |