require_once'modules/logger.php';
$Logger = new Logger();
require_once 'templates/list.php';
$Templates = new templatesList();
require_once 'widgets/list.php';
$Widgets = new widgetsList();
我templates/list.php
和widgets/list.php
使用$Logger
。 $Templates
我用於/widgets/list.php
。PHP和一些全局變量
上面的代碼引發此錯誤:
Notice: Undefined variable:
Logger
in.../templates/list.php
on line 99 Fatal error: Call to a member functiontoLog()
on a non-object in.../templates/list.php
on line 99
UPD 下面是一行99:
$Logger->toLog($contentData);
你的線99是哪裏?你可以發佈嗎? – SilentGhost 2009-08-27 10:39:27