경로(path) Sample

<?php
/**
 * Path helper
 *
 * Created on 2011. 11. 18.
 * @author 불의회상 <hoksi2k@hanmail.net>
 * @package helper
 * @subpackage controllers
 * @version 1.0
 */
class Path_hlp extends CI_Controller {
	function __construct()
	{
		parent::__construct();
		
		$this->load->helper('path');
	}
	
	function index() {
		// 경로가 실재로 존재하는지를 검사합니다
		$data['set_realpath'] = set_realpath('text/passwd');
		
		// 옵션인 두번째 파라미터  FALSE 로 설정시 path가 존재하지 않으면 넘겨준 경로값을 다시 리턴
		// 기본값 FALSE
		$data['set_realpath_err_off'] = set_realpath('text/passwd', FALSE);

		$this->load->view('path_hlp_sample', $data);
	}
}
<?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>set_realpath('text/passwd')</td>
	<td><?php echo $set_realpath?></td>
</tr>
<tr>
	<td>set_realpath('text/passwd', TRUE)</td>
	<td>옵션인 두번째 파라미터  TRUE 로 설정시 path가 존재하지 않으면 에러를 발생</td>
</tr>
<tr>
	<td>set_realpath('text/passwd', FALSE)</td>
	<td><?php echo $set_realpath_err_off?></td>
</tr>
</table>

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

© Copyright by hoksi(Page rendered in 0.0137 seconds)