{ldelim} {if isset($errors) && $errors} "hasError" : true, "errors" : [ {foreach from=$errors key=k item=error name='errors'} "{$error}"{if !$smarty.foreach.errors.last},{/if} {/foreach} ] {else} "hasError" : false {/if} {rdelim}