我正在尝试将外部库加载到 ExpressionEngine 插件中,但得到:
消息:未定义属性:Detector::$EE
在插件本身中,我有:
public function __construct()
{
$this->EE->load->library('detector');
$this->EE =& get_instance();
}
我的文件夹设置如下:
检测器
-libraries
--Detector.php
-pi.detector.php
我究竟做错了什么?
经过加载库错误后,我现在收到带有以下代码的“未定义变量”错误:
public function detector()
{
return $ua->ua;
}
public function user_agent()
{
return $ua->ua;
}
那就是如果我的模板中有 {exp:detector:user_agent} 。如果我 {exp:detector} 我没有输出。