We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Using Twitter Bootstrap/Font Awesome icons in Form Builder

Is there any way to set the value of a button in the forms builder to use HTML (not escaped) so that we can add icons from icon libraries to our buttons?

   $this->add(new Submit('Login', array(
        'class' => 'btn btn-success',
        'value' => 'Login <i class="fa fa-fw fa-sign-in"></i>'
    )));

If not I'll just stick to adding this element in the raw HTML.

thats awesome.

I would like to suggest you hack https://docs.phalcon.io/en/latest/api/Phalcon_Tag.html When you initialize di setAutoescape(false) to tag

The following allowed use of font awesome icon tags in form labels...

$di = new FactoryDefault();

$di->setAutoescape(false);