Radical Design Course by Jack McDade

From the creator of Statamic

Learn how to make your websites standout and be remembered.

Taking your approach on designing things actually makes it fun, more natural, and overall easier.

— Dominik, Developer

old

An array of sanitized variables POSTed from the previous request.

In certain forms – for example, {{ user:login_form }} – you may encounter validation errors that will require you to resubmit your the form.

Instead of making your users re-type everything, you may use {{ old:[field_name] }} tag to display their previously-entered input values.

When using the {{ user:login_form }} to login, upon entering incorrect credentials, you will be shown the same page. You can use the {{ old:[field_name] }} tags to maintain the values like so:

{{ user:login_form }}
 
{{ if errors }}
...
{{ /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 }}
<s:user:login_form>
@if (count($errors) > 0)
...
@endif
 
<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>
 
</s:user:login_form>
Docs feedback

Submit improvements, related content, or suggestions through Github.

Betterify this page →