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;
    }
}


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM