2013-10-27 58 views
0

我读码Kohana中,我看到自动加载类Kohana的

bootstrap.php中

spl_autoload_register(array('Kohana', 'auto_load')); 

的index.php

echo SPMY_OMG::$run; 

我创建的文件在\ Kohana的\应用\ classes \ SPMY \ OMG

class SPMY_OMG{ 
static public $run=189; 
} 

为什么ErrorException [致命错误]:未找到类'SPMY_OMG' ??

回答

2

引导仅在索引后运行。所以自动装载机仍然需要定义。

它是什么,要达到什么目的?如果您想使用自动加载器,则必须在自动加载器安装完成后执行此操作。

+0

Thanks.Which file do access to access? –

+0

@MichelPhelps你是什么意思? – Ikke