로더(load) Sample

<?php
/**
 * Load Class
 *
 * Created on 2011. 11. 16.
 * @author 불의회상 <hoksi2k@hanmail.net>
 * @package library
 * @subpackage controllers
 * @version 1.0
 */
class Load_lib extends CI_Controller {
	function __construct() {
		parent::__construct();
	}
	
	function index() {
		$data = array(
			'test' => 1111,
			'file_load' => $this->load->file('sample/text/myhtm.txt', TRUE)
		);
		
		$this->load->vars($data);
		
		$this->load->view('load_lib_sample');
	}
}
<?php $this->load->view('inc/header')?>

<table class="tablesorter" border="0" cellpadding="0" cellspacing="1">
<thead>
<tr>
  <th style="text-align:center" width="20%">구분</th>
  <th width="80%">결과</th>
</tr>
</thead>
<tr>
  <td>$this->load->vars($data)</td>
  <td><?=$test?></td>
</tr>
<tr>
  <td>$this->load->get_var('test')</td>
  <td><?=$this->load->get_var('test')?></td>
</tr>
<tr>
  <td>$this->load->file('sample/text/myhtm.txt')</td>
  <td><pre><?php $this->load->file('sample/text/myhtm.txt')?></pre></td>
</tr>
<tr>
  <td>$this->load->file('sample/text/myhtm.txt', TRUE)</td>
  <td><pre><?=$file_load?></pre></td>
</tr>
</table>

<?php $this->load->view('inc/footer')?>

© Copyright by hoksi(Page rendered in 0.0300 seconds)