yaf. use_namespace=1的情况下,controller怎么使用namespace


请教个问题:
yaf. use_namespace=1的情况下,controller怎么使用namespace?

比如:Index.php的内容


 use Yaf\Controller_Abstract;
use Yaf\Dispatcher;
class IndexController extends Controller_Abstract
{
    public function indexAction()
    {
        Dispatcher::getInstance()->disableView(0);
        echo 'Great,It Works!';
    }
}

没法加namespace了,文件名是Index.php

路过的怎么处理的,说说

Yaf php

你妹你妹囧你妹 8 years, 6 months ago

我也想知道答案。 原本想


 <?php
namespace App\Controllers;

class IndexController extends Yaf\Controller_Abstract
{
    function indexAction()
    {
        // do sth.
    }
}

一直报错。去掉 namespace App\Controllers 就行。不知道怎么办了。

甜菜119 answered 8 years, 6 months ago

Your Answer