• 请不要在回答技术问题时复制粘贴 AI 生成的内容
yakczh
V2EX  ›  程序员

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

  •  
  •   yakczh · Nov 30, 2013 · 5889 views
    This topic created in 4558 days ago, the information mentioned may be changed or developed.
    用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) 呢?
    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2991 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 14:46 · PVG 22:46 · LAX 07:46 · JFK 10:46
    ♥ Do have faith in what you're doing.