Template directive: old

The @old directive is similar to @get and @post directives. It is used to obtain the last value sent from a form's get or post request method. This means that it can be used for either post or get request.
old
Example: Old
  <form method="post">
  
    @csrf

    <input type="text" name="username" value="@old.username" >
    <input type="password" name="pass" value="@old.pass">

    <button @btn('login')></button> 
    
  </form>
                  
This can also be used for obtaining string or integer values from a form's array data. This is shown below
  <form method="post">
  
    @csrf

    <input type="text" name="names[]" value="@old.names[0]" >
    <input type="text" name="names[]" value="@old.names[1]">

    <button @btn('save')></button>
    
  </form>
                  
From the sample above, since the name attribute is an array, the @old directive makes it easier to obtain the last value of the array by supplying the array key. The value will be added only when it exists.