yaf设置命名空间

修改yaf配置文件

文件是:yaf.ini

extension=yaf.so
yaf.use_namespace=1

index文件.

目录是application/controllers/Index.php

class IndexController extends Yaf\Controller_Abstract {
    public function init() {
        Yaf\Dispatcher::getInstance()->disableView();
    }
    /**
     * 默认控制器
     */
    public function indexAction() {
        $site   =   Yaf\Application::app()->getConfig();
        $re = $site->application->ext;
        $this->getView()->assign('content','welcome,The yaf is works!');
        $this->getView()->display('./index/index.html');
        exit;
    }
}
posted @ 2016-01-10 01:28  KoMiles  阅读(2216)  评论(0编辑  收藏  举报