Last active
November 4, 2022 14:41
-
-
Save prezire/795f52ca3702ee63e0a0 to your computer and use it in GitHub Desktop.
Helps view rendering for CodeIgniter 3.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function showView($view, $data = null) | |
{ | |
$CI = get_instance(); | |
$CI->load->view('commons/layouts/header', $data); | |
$CI->load->view($view, $data); | |
$CI->load->view('commons/layouts/footer', $data); | |
} | |
function showJsonView($data, $status = 200) | |
{ | |
exit($this->output | |
->set_status_header($status) | |
->set_content_type('application/json') | |
->set_output(json_encode($data)) | |
->_display()); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment