O
O
Oklick2016-09-01 00:29:37
Zend Framework
Oklick, 2016-09-01 00:29:37

How to insert tags in Zend Framework 2 inside a Label (the form is created using Form)?

Good time!
The problem is that when creating a form, I need to insert a span tag inside the label so that the text written there is smaller than the main one, but if I write tags directly:

$this->add(array(
            'name' => 'login',
            'options' => array(
                'label' => '<b>Логин</b>'
            ),
.....................

then they are displayed as a result as text, the browser does not perceive them as html elements.
In ZF1, such a problem is solved simply by turning it off . Here, such a thing will not work. Help find a solution. Thanks in advance. 'escape' => false,

Answer the question

In order to leave comments, you need to log in

1 answer(s)
C
Cat Anton, 2016-09-01
@Oklick

$this->add(array(
    'name' => 'login',
    'options' => array(
        'label' => '<b>Логин</b>',
        'label_options' => array(
            'disable_html_escape' => true
        )
    )
));

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question