Refactored Form system to get simple error handling and a clearer
interface
This commit is contained in:
@@ -3,10 +3,10 @@
|
||||
{form name="thelia.customer.creation"}
|
||||
<form method="post" action="index_dev.php?action=createCustomer&view=connexion" {form_enctype form=$form} >
|
||||
|
||||
{form_field_hidden form=$form}
|
||||
{form_hidden_fields form=$form}
|
||||
|
||||
{form_field form=$form.title}
|
||||
{form_error form=$form.title}
|
||||
{form_field form=$form field="title"}
|
||||
{form_error form=$form field="title"}
|
||||
{$message}
|
||||
{/form_error}
|
||||
|
||||
@@ -19,64 +19,64 @@
|
||||
<br />
|
||||
{/form_field}
|
||||
|
||||
{form_field form=$form.firstname}
|
||||
{form_error form=$form.firstname}
|
||||
{form_field form=$form field="firstname"}
|
||||
{form_error form=$form field="firstname"}
|
||||
{$message}
|
||||
{/form_error}
|
||||
|
||||
<label> <span>{intl l="{$label}"} : </span></label><input type="text" name="{$name}" value="{$value}" {$attr} > <br />
|
||||
{/form_field}
|
||||
|
||||
{form_field form=$form.lastname}
|
||||
{form_error form=$form.lastname}
|
||||
{form_field form=$form field="lastname"}
|
||||
{form_error form=$form field="lastname"}
|
||||
{$message}
|
||||
{/form_error}
|
||||
|
||||
<label> <span>{intl l="{$label}"} : </span></label><input type="text" name="{$name}" value="{$value}" {$attr} > <br />
|
||||
{/form_field}
|
||||
|
||||
{form_field form=$form.address1}
|
||||
{form_error form=$form.address1}
|
||||
{form_field form=$form field="address1"}
|
||||
{form_error form=$form field="address1"}
|
||||
{$message}
|
||||
{/form_error}
|
||||
|
||||
<label> <span>{intl l="{$label}"} : </span></label><input type="text" name="{$name}" value="{$value}" {$attr} > <br />
|
||||
{/form_field}
|
||||
|
||||
{form_field form=$form.address2}
|
||||
{form_error form=$form.address2}
|
||||
{form_field form=$form field="address2"}
|
||||
{form_error form=$form field="address2"}
|
||||
{$message}
|
||||
{/form_error}
|
||||
|
||||
<label> <span>{intl l="{$label}"} : </span></label><input type="text" name="{$name}" value="{$value}" {$attr} > <br />
|
||||
{/form_field}
|
||||
|
||||
{form_field form=$form.address3}
|
||||
{form_error form=$form.address3}
|
||||
{form_field form=$form field="address3"}
|
||||
{form_error form=$form field="address3"}
|
||||
{$message}
|
||||
{/form_error}
|
||||
|
||||
<label> <span>{intl l="{$label}"} : </span></label><input type="text" name="{$name}" value="{$value}" {$attr} > <br />
|
||||
{/form_field}
|
||||
|
||||
{form_field form=$form.zipcode}
|
||||
{form_error form=$form.zipcode}
|
||||
{form_field form=$form field="zipcode"}
|
||||
{form_error form=$form field="zipcode"}
|
||||
{$message}
|
||||
{/form_error}
|
||||
|
||||
<label> <span>{intl l="{$label}"} : </span></label><input type="text" name="{$name}" value="{$value}" {$attr} > <br />
|
||||
{/form_field}
|
||||
|
||||
{form_field form=$form.city}
|
||||
{form_error form=$form.city}
|
||||
{form_field form=$form field="city"}
|
||||
{form_error form=$form field="city"}
|
||||
{$message}
|
||||
{/form_error}
|
||||
|
||||
<label> <span>{intl l="{$label}"} : </span></label><input type="text" name="{$name}" value="{$value}" {$attr} > <br />
|
||||
{/form_field}
|
||||
|
||||
{form_field form=$form.country}
|
||||
{form_error form=$form.country}
|
||||
{form_field form=$form field="country"}
|
||||
{form_error form=$form field="country"}
|
||||
{$message}
|
||||
{/form_error}
|
||||
|
||||
@@ -89,43 +89,43 @@
|
||||
<br />
|
||||
{/form_field}
|
||||
|
||||
{form_field form=$form.phone}
|
||||
{form_error form=$form.phone}
|
||||
{form_field form=$form field="phone"}
|
||||
{form_error form=$form field="phone"}
|
||||
{$message}
|
||||
{/form_error}
|
||||
<label> <span>{intl l="{$label}"} : </span></label><input type="text" name="{$name}" value="{$value}" {$attr}> <br />
|
||||
{/form_field}
|
||||
|
||||
{form_field form=$form.cellphone}
|
||||
{form_error form=$form.cellphone}
|
||||
{form_field form=$form field="cellphone"}
|
||||
{form_error form=$form field="cellphone"}
|
||||
{$message}
|
||||
{/form_error}
|
||||
<label> <span>{intl l="{$label}"} : </span></label><input type="text" name="{$name}" value="{$value}" {$attr}> <br />
|
||||
{/form_field}
|
||||
|
||||
{form_field form=$form.email}
|
||||
{form_error form=$form.email}
|
||||
{form_field form=$form field="email"}
|
||||
{form_error form=$form field="email"}
|
||||
{#message}
|
||||
{/form_error}
|
||||
<label><span>{intl l="{$label}"}</span></label><input type="email" name="{$name}" value="{$value}" {$attr} ><br />
|
||||
{/form_field}
|
||||
|
||||
{form_field form=$form.email_confirm}
|
||||
{form_error form=$form.email_confirm}
|
||||
{form_field form=$form field="email_confirm"}
|
||||
{form_error form=$form field="email_confirm"}
|
||||
{#message}
|
||||
{/form_error}
|
||||
<label><span>{intl l="{$label}"}</span></label><input type="email" name="{$name}" {$attr} ><br />
|
||||
{/form_field}
|
||||
|
||||
{form_field form=$form.password}
|
||||
{form_error form=$form.password}
|
||||
{form_field form=$form field="password"}
|
||||
{form_error form=$form field="password"}
|
||||
{#message}
|
||||
{/form_error}
|
||||
<label><span>{intl l="{$label}"}</span></label><input type="password" name="{$name}" {$attr} ><br />
|
||||
{/form_field}
|
||||
|
||||
{form_field form=$form.password_confirm}
|
||||
{form_error form=$form.password_confirm}
|
||||
{form_field form=$form field="password_confirm"}
|
||||
{form_error form=$form field="password_confirm"}
|
||||
{#message}
|
||||
{/form_error}
|
||||
<label><span>{intl l="{$label}"}</span></label><input type="password" name="{$name}" {$attr} ><br />
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
{include file="includes/header.html"}
|
||||
<div>
|
||||
|
||||
{loop type="auth" name="auth_test" roles="CUSTOMER"}
|
||||
{loop type="auth" name="auth_test" context="front" roles="CUSTOMER"}
|
||||
|
||||
<p>Customer is authentified :-)</p>
|
||||
{/loop}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user