Login Form

Generate necessary markup to create a User login form.


Example

A basic login form, with validation errors.

{{ user:login_form }}

    {{ if errors }}
        <div class="alert alert-danger">
            {{ errors }}
                {{ value }}<br>
            {{ /errors }}
        </div>
    {{ /if }}


    <label>Username</label>
    <input type="text" name="username" value="{{ old:username }}" />

    <label>Password</label>
    <input type="password" name="password" value="{{ old:password }}" />

    <button>Log in</button>

{{ /user:login_form }}

Parameters

attr

string

Set HTML attributes, e.g., attr="class:form|id:form"

redirect

string

Where the user should be taken after successfully logging in.

allow_request_redirect

boolean

When set to true, the redirect parameter will get overridden by a redirect query parameter in the URL.


Variables

errors

array

An array of validation errors.

Last modified on December 14, 2017