0

in cakephp 4 there is a statement/method like

$this->Form->control('address_id',['options' => $addresstypes...]....

which mainly works fine. I my case I would like to change the label of an select box to an external link.

Now safe, but in this case unfortunate adding the option:

'label' => '<a href="whatever">whatever</a>'

renders my link useless because due to safety reasons it translates to:

&lt;a href="whatever"&gt;whatever&lt;/a&gt;

Obvious is also that this is a nice feature except you want to turn a label into a link.

Anybody an idea? Otherwise I have to rewrite a couple of hundreds of $this->Form->control...

statements.

Thx

1 Answers1

1

I can't find it explicitly documented for the label attribute, but if you add 'escape' => false to your options in such cases, that should take care of it.

Greg Schmidt
  • 5,010
  • 2
  • 14
  • 35