0

[STDERR] PHP 致命错误:在第 62 行的 /upload/catalog/view/theme/Super_green/template/common/header.tpl 中调用未定义的方法 Customer::isOwnStudents()

header.tpl 看起来像

<?php
if ($this->customer->isLogged()) {
if($this->customer->isOwnStudents()>0) echo $orderfood;
echo $language . $currency . $cart . $konto;`}
?>

class ModelAccountStudents extends Model {  

public function isOwnStudents() {
        $results = $this->getStudentses();
        if(sizeof($results)>0) return true;
        else return false;
    } 

这段代码有什么问题。我不知道为什么我会犯这个错误。

4

1 回答 1

0

从您的代码来看,它看起来像是$this->customer一个实例Customer- 您已经isOwnStudents()为类定义了方法ModelAccountStudents,而不是Customer类。

于 2013-11-14T22:55:10.243 回答