From e23bdbb45f0eb058d721705560143cb8b77e1d18 Mon Sep 17 00:00:00 2001 From: Alex Tselegidis Date: Tue, 18 Jan 2022 09:40:13 +0100 Subject: [PATCH] Render with the html_vars helper. --- application/helpers/render_helper.php | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/application/helpers/render_helper.php b/application/helpers/render_helper.php index d4ff9c11..bfbf9ab4 100644 --- a/application/helpers/render_helper.php +++ b/application/helpers/render_helper.php @@ -26,10 +26,12 @@ function render_timezone_dropdown(string $attributes = ''): string $timezones = $CI->timezones->to_grouped_array(); - return $CI->load->view('components/timezone_dropdown', [ - 'timezones' => $timezones, - 'attributes' => $attributes - ], TRUE); + html_vars([ + 'attributes' => $attributes, + 'timezones' => $timezones + ]); + + return $CI->load->view('components/timezone_dropdown', html_vars(), TRUE); } /** @@ -43,9 +45,11 @@ function render_language_script(string $attributes = ''): string { $CI = get_instance(); - return $CI->load->view('components/language_script', [ - 'attributes' => $attributes - ], TRUE); + html_vars([ + 'attributes' => $attributes, + ]); + + return $CI->load->view('components/language_script', html_vars(), TRUE); } /** @@ -59,7 +63,9 @@ function render_global_variables_script(string $attributes = ''): string { $CI = get_instance(); - return $CI->load->view('components/global_variables_script', [ - 'attributes' => $attributes - ], TRUE); + html_vars([ + 'attributes' => $attributes, + ]); + + return $CI->load->view('components/global_variables_script', html_vars(), TRUE); }