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 · 5430 次点击
    这是一个创建于 3793 天前的主题,其中的信息可能已经有所发展或是发生改变。
    用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   ·   我们的愿景   ·   实用小工具   ·   5297 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 07:56 · PVG 15:56 · LAX 00:56 · JFK 03:56
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.