友情链接
在线网页工具
基本上无需手动加载类库文件,你可以很方便的完成自动加载。
系统可以通过类的命名空间自动定位到类库文件,fastmvc的加载机制说明
spl_autoload_register(function($name){ if (is_file($path = APP_PATH . $name . '.php') || is_file($path = DIR_PATH . $name . '.php')) { require_once $path;<BR> } });
如需实化:
{APP_PATH}lib/File.php {APP_PATH}www/w/Index.php
只需要
new \lib\File; new \www\w\Index
如果是model,core等同如上方法