{dont_wrap}({ldelim} 'errors': {ldelim}{foreach from=$form.errors key="element" item="message" name="errors"} '{$element}': '{$message|lang|ucfirst}'{if !$smarty.foreach.errors.last},{/if} {/foreach} {rdelim}, 'data':'{$data|replace:"\n":''|replace:"\r":''|replace:"'":"\\'"}', 'location':{if $link}'{$link}'{else}0{/if} {rdelim})