render template and array