Skip to content

How to embed the login form on another page

RWOverdijk edited this page Feb 26, 2013 · 4 revisions

Task

Embed the login form on another page (ie: homepage login widget)

Solution

ZfcUser provides a View Helper (zfcUserLoginWidget) which you can use from any view script in your application. Just add the following call to the location in your markup where you want the form to be rendered:

<?php echo $this->zfcUserLoginWidget(); ?>

Note

The view helper can also return the login form:

<?php $form = $this->zfcUserLoginWidget(array('render' => false)); ?>

This will return an object of type Login that can be used to generate a custom login form.