| 제목 | 파서에 대한 이해력 부족인지...질문좀 드립니다. | ||
|---|---|---|---|
| 글쓴이 | 터푸 | 작성시각 | 2011/03/03 14:57:06 |
|
|
|||
|
class Index extends CI_Controller { public function index($url=''){ |
|||
| 다음글 | 급조언 구합니다!! (1) | ||
| 이전글 | jQuery의 validate와 Codeigniter의... (3) | ||
|
milosz
/
2011/03/03 20:04:36 /
추천
0
|
이렇게 하시려면 파서만 적용될 범위를 index에서 분리하셔서 파서로 넘겨주시거나
$htmldata도 파서로 같이 넘겨줘야겠습니다.
흔히 템플릿 사용하는 경우를 고려해서... 후자의 방법이라면..
class Index extends CI_Controller { public function __construct(){ parent::__construct(); $this->load->library('session'); } public function index($url=''){ $this->load->library('parser'); $page = $this->session->userdata('mb_id') ? 'index_top_login' : 'index_top'; $tmp_list=array( 'header' => $this->load->view('index_header','',true), 'footer' => $this->load->view('index_bottom','',true), 'top_menu' => $this->load->view($page,'',true), 'blog_title' => 'My Blog Title', 'blog_heading' => 'My Blog Heading' ); $this->parser->parse('index',$tmp_list); } }다른 얘긴데요; 뷰 사용하시는 방법이 저랑 다르네요. 저는 값으로 넘기지 않고 다 나열하는 편인데
속도에 이점이나.. 기타 다른 부분이 있는지 궁금합니다.