Fatal error: Class 'Phalcon\Http\Client\Request'

谁都会走 提交于 2019-12-02 05:55:45

问题


Error on request

Fatal error: Class 'Phalcon\Http\Client\Request' not found in ControllerBase.php on line 41

use Phalcon\Http\Client\Request as CRequest;

 $provider = CRequest::getProvider();
            $provider->setBaseUri('http://localhost/testing');

回答1:


You will need to a copy of the incubator library files from the Phalcon/Incubator github. Download and copy all or just the HTTP directory to your /app/library/ folder. In your public/index.php, add $loader->registerNamespaces with the correct path to the incubator library.

$loader = new Phalcon\Loader();

$loader->registerNamespaces(array(
    'Phalcon' => APP_PATH . 'app/library/'
));

$loader->register();

Source: https://github.com/phalcon/incubator#autoloading-from-the-incubator



来源:https://stackoverflow.com/questions/31218158/fatal-error-class-phalcon-http-client-request

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!