CI 묻고 답하기

제목 아애 안보인다는 _output function 입니다.
카테고리 CI 2, 3
글쓴이 엘제이 작성시각 2020/07/14 13:32:32
댓글 : 2 추천 : 0 스크랩 : 0 조회수 : 12788   RSS

이부분의 코든 컨트롤러 안의 $this->load->view() 보다 나중에 alert 이 나옵니다.

 

<?php

Class MY_Controller extends CI_Controller

{

//// 생략 /////

 

public function _output($output)

{

$type = $this->output->get_content_type();

$is_html = strpos($type, 'html') !== FALSE;

/*

* HTML 출력일때

*/

extract($this->vars);

$CONTENT = $output;

$layout_file = VIEWPATH . '_layout/layer.' . $this->_layout . '.php';

if (file_exists($layout_file) === FALSE) {

$layout_file = VIEWPATH . '_layout/layer.default.php';

}

ob_start();

include_once $layout_file;

$output = ob_get_clean();

unset($CONTENT);

if (ENVIRONMENT != 'development') { // --

$output = preg_replace('/("|\')(\/www)(\/src\/)(css|js)/im', '$1$2/dist/$4', $output);

}

//if ($is_html) print mb_convert_encoding(trim($output), 'HTML-ENTITIES', 'AUTO') . PHP_EOL;

print trim($output);

}

 

 다음글 Codeigniter4 Redis session 오류 (2)
 이전글 view를 출력하는 과정에서 질문드립니다. (1)

댓글

엘제이 / 2020/07/14 13:35:13 / 추천 0

$this->_output(

self::_output(

$CI->_output(  

해도 검색이 안됩니다. ㅠㅠ

변종원(웅파) / 2020/07/14 15:21:28 / 추천 0