V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
yakczh
V2EX  ›  程序员

PhalconException: Service 'view' wasn't found in the dependency injection container

  •  
  •   yakczh · 2013-11-30 15:02:24 +08:00 · 5447 次点击
    这是一个创建于 3860 天前的主题,其中的信息可能已经有所发展或是发生改变。
    用Phalcon做服务器接口,只输出json,把输出模板的路径配置
    $di->set('view', function(){
    $view = new \Phalcon\Mvc\View();
    $view->setViewsDir('../app/views/');
    return $view;
    });
    注释掉 提示 
    PhalconException: Service 'view' wasn't found in the dependency injection container
    如果不输出模板,只是输出json_encode($data) 呢?
    目前尚无回复
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   2509 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 00:25 · PVG 08:25 · LAX 17:25 · JFK 20:25
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.