How to use Bootstrap for ZfcUser forms in Zend Framework 2.5

Hi guys! In this tutorial I will explain how to customize the forms in Zend Framework 2.5 with Bootstrap's styles. I will add Bootstrap's styles in ZfcUser's forms.

First, I have added the Boostrap link into my layout:

headLink()
->prependStylesheet($this->basePath('css/bootstrap-theme.min.css'))
->prependStylesheet($this->basePath('css/bootstrap.min.css')) ?>


headScript()
->prependFile($this->basePath('js/bootstrap.min.js'))
->prependFile($this->basePath('js/jquery.min.js'))
; ?>

Next, I will open my Form/login file and I will add:


'class'=>'form-control'

into

'attributes' => array(
),

In this way I will add Boostrap's styles on my inputs fields.

Now, I want customize my button and I will add:

'class' => 'btn btn-lg btn-primary btn-block btn-signin',

into

->setAttributes(array(
));

Video tutorial:









Leave a Comment