$this->ci =& get_instance(); echo $this->ci->load->_ci_view_path;이렇게 하면 자꾸 에라가 나는데요.. 사용못하나요?
Severity: Notice
Message: Undefined property: Test::$_ci_view_path
ㅎㅎ
$this->ci->_ci_view_path;
의 오타 인듯.. ^^
$hook['post_controller_constructor'][] = array(
'class' => 'Mobile',
'function' => 'view_set',
'filename' => 'Mobile.php',
'filepath' => 'hooks'
);
$hook['display_override'][] = array(
'class' => 'Mobile',
'function' => 'display',
'filename' => 'Mobile.php',
'filepath' => 'hooks'
);
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Mobile {
function Mobile()
{
$this->ci =& get_instance();
$this->ci->load->library('user_agent');
}
function view_set()
{
if ($this->ci->agent->is_mobile())
{
$this->ci->load->_ci_view_path .= 'mobile/';
}
}
function display()
{
if ($this->ci->agent->is_mobile())
{
$buffer = $this->ci->output->get_output();
$buffer = preg_replace("/\n/", '', $buffer);
$buffer = mb_convert_kana($buffer, 'aks', "UTF-8");
$buffer = mb_convert_encoding($buffer, 'SJIS', $this->ci->config->item('charset'));
header("Content-type: text/html; charset=Shift_JIS;");
echo $buffer;
}
else
{
echo $this->ci->output->get_output();
}
}
}
$this->ci->_ci_view_path 가 맞는거 같은데요
$this->ci->load->_ci_view_path; 이게 이해가 안되네요.
파일도 아니고 모델, 뷰도 아니고 ci 로드 규칙에 없는건데요?