2015. 3. 6. 11:37ㆍFrontEnd/Web
<?
class singleT
{
private $data=array();
private $url="";
public $msg = '';
static private $instance = NULL;
static function getInstance()
{
if (self::$instance == NULL)
{
self::$instance = new singleT();
}
return self::$instance;
}
function setUrl($url)
{
$this->url=$url;
}
function setData($arr)
{
$this->data=$arr;
}
function getData()
{
$getdata = '알아서 처리';
return $getdata;
}
function _how_to_log()
{
self::_alert('?');
}
//class alert
function _alert($m){
$this->msg = $m;
$printMsg .= '<meta charset="utf-8""/>';
$printMsg .= '<script>'."\n";
$printMsg .= 'alert("'.$this->msg.'")';
$printMsg .= '</script>';
echo $printMsg;
}
}
?>
/*
how to use..?
$a = singleT::getInstance();
$data = array('id' => '101'.$i, 'name'=>'11', 'value' =>'123');
$a->setData($data);
$aString = $a->getData();
*/
'FrontEnd > Web' 카테고리의 다른 글
[php]변수명조합 (0) | 2015.03.17 |
---|---|
크롬 input 자동완성 (0) | 2015.03.17 |
[mysql] skip-name-resolve 설정 (0) | 2015.03.05 |
KeyCode 표 (0) | 2015.02.23 |
php microtime() 함수 (0) | 2015.02.11 |