타이포그라피(typography) Sample

<?php
/**
 * Typography Class
 *
 * Created on 2011. 11. 16.
 * @author 불의회상 <hoksi2k@hanmail.net>
 * @package library
 * @subpackage controllers
 * @version 1.0
 */
class Typography_lib extends CI_Controller {
	function __construct() {
		parent::__construct();
	}
	
	function index() {
		$this->load->library('typography');
		$data['string'] = htmlspecialchars("단락을 <p></p>로 감쌉니다 (단락을 식별할수 있도록 2줄 줄바꿈 한것 처럼 보이게 됩니다).
한줄바꿈은<br />로 변경합니다.이때 <pre> 안에 있는것은 변경하지 않습니다.
<div> 태그같은 블록수준의 요소들은 단락으로 감싸지 않으며, 포함하고 있는 텍스트가 단락을 포함한다면 그부분은 감쌉니다.
문장뒤에 나오는 두개의 공백은 실재공백이 아닌 non-breaking 공백으로 변환되어 두개공백을 표현합니다.");
		
		$data['auto_typography'] = $this->typography->auto_typography($data['string']);
		$data['format_characters'] = $this->typography->format_characters($data['string']);
		$data['nl2br_except_pre'] = $this->typography->nl2br_except_pre($data['string']);
		
		$this->load->view('typography_lib_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>원본 TEXT</td>
	<td><xmp><?php echo $string?></xmp></td>
</tr>
<tr>
	<td rowspan="2">$this->typography->auto_typography()</td>
	<td><xmp><?php echo $auto_typography?></xmp></td>
</tr>
<tr>
	<td><?php echo $auto_typography?></td>
</tr>
<tr>
	<td rowspan="2">$this->typography->format_characters()</td>
	<td><xmp><?php echo $format_characters?></xmp></td>
</tr>
<tr>
	<td><?php echo $format_characters?></td>
</tr>
<tr>
	<td rowspan="2">$this->typography->nl2br_except_pre()</td>
	<td><xmp><?php echo $nl2br_except_pre?></xmp></td>
</tr>
<tr>
	<td><?php echo $nl2br_except_pre?></td>
</tr>
</table>

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

© Copyright by hoksi(Page rendered in 0.0072 seconds)