这里是如果有错误的部分。
致命错误:使用$这个时候不是在第6行中/pb_events.php对象上下文
线6为: $jpp = $this->vars->data["jpp"];
function DoEvents($this) {
global $_CONF, $_PAGE, $_TSM , $base;
$jpp = $this->vars->data["jpp"];
$cache["departments"] = $this->db->QFetchRowArray("SELECT * FROM {$this->tables[job_departments]}");
$cache["locations"] = $this->db->QFetchRowArray("SELECT * FROM {$this->tables[job_location]}");
$cache["names"] = $this->db->QFetchRowArray("SELECT * FROM {$this->tables[job_names]}");
$cache["categories"] = $this->db->QFetchRowArray("SELECT * FROM {$this->tables[job_categories]}");
非常感谢! 欣赏!
$这不仅使在方法的意义,而不是在功能
还行吧
class Foo {
function bar() {
$this->...
这不是
function some() {
$this->
//编辑:没有注意到他通过“$这个”作为参数
建议:只需更换“$这个”用“$ somethingElse”
你不能通过$this
的程序功能。 $this
是保留的变量。
按我的意见。 你想用$this
作为传递的变量和PHP不允许它外面类的方法体。
function DoEvents($obj) {
global $_CONF, $_PAGE, $_TSM , $base;
$jpp = $obj->vars->data["jpp"];
$cache["departments"] = $obj->db->QFetchRowArray("SELECT * FROM {$obj->tables[job_departments]}");
$cache["locations"] = $obj->db->QFetchRowArray("SELECT * FROM {$obj->tables[job_location]}");
$cache["names"] = $obj->db->QFetchRowArray("SELECT * FROM {$obj->tables[job_names]}");
$cache["categories"] = $obj->db->QFetchRowArray("SELECT * FROM {$obj->tables[job_categories]}");
你必须让对象第一。
$object=new Myobject;
DoEvents($object);