Skip to main content

How to embed the login form on another page

Task

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

Solution

LmcUser provides a View Helper (LmcUserLoginWidget) 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->lmcUserLoginWidget(); ?>

Note

The view helper can also return the login form:

<?php $form = $this->lmcUserLoginWidget(['render' => false]); ?>

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