Menu

#422 Add a doc to label

None
open
nobody
None
1
2020-07-24
2020-07-17
lacroix
No

Hi team,
How can i add a link (ex: <a href) into a new label ? PB with setlabel.
thanks for you help.

Discussion

  • Campbell Morrison

    Sorry, could you explain some more please?

     
  • Anonymous

    Anonymous - 2020-07-21

    Sorry for few details.
    In the form, i add a new field, you can see on screenshot, it's work.
    i would like attach a link for explainations users, how can i can do this ?
    it's works under 171.
    Thank for you help. PL

     
  • Campbell Morrison

    You'll need to modify the code so that the label isn't escaped. Change line 58 of lib/MRBS/Form/Field.php from

        $label->setText($text);
    

    to

        $label->setText($text, false, true);
    
     
  • Campbell Morrison

    I've now added a $raw parameter to Field->setLabel() to enable HTML tags to be used in a label. This will enable just specific fields to have raw labels by changing the code that builds the form.

     
  • lacroix

    lacroix - 2020-07-24

    Campbell, thk you so much. It's works fine.
    Respect for good dev :), Pierre