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