We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Angular-ui modal and phalcon, error sending data into modal controller from $http

I'm using the angular-ui modal directive. And tried to fetch data from my phalcon controller, but I get an error:

Fatal error: Uncaught Error: Access to undeclared static property: Phalcon\Di::$_default in C:\xampp\htdocs\cofiso\app\library\Base\Services.php:9 Stack trace: #0 [internal function]: Phalcon\Di->construct() #1 C:\xampp\htdocs\cofiso\app\library\Base\Services.php(9): Phalcon\Di\FactoryDefault->construct() #2 C:\xampp\htdocs\cofiso\public\index.php(25): Base\Services->__construct(Object(Phalcon\Config\Adapter\Ini)) #3 {main} Next Error: Access to undeclared static property: Phalcon\Di::$_default in C:\xampp\htdocs\cofiso\app\library\Base\Services.php on line 9

I have explained it here stackoverflow

I put all the code Angular and in the end PHP Phalcon. I hope someone can help me. Thanks in advance for your help.

https://github.com/phalcon/cphalcon/issues/12056

Switch your configuration to vagrant/docker, eventually usi php-cgi + apache/nginx instead of apache php module.



3.4k

On your StackOverflow question, can you merge your post with the PHP code into your original post and remove the Angular stuff, it's irrelevent. The issue is with PHP.

Can you also supply the source for app/library/Base/Services.php (removing all confidential details)

I just read this in the link of #Wojciech => https://github.com/phalcon/cphalcon/issues/12056 , And says that: It occurs when I refresh the page very fast, and also when multiple ajax request are executed at the same time, bummer.

And I think it's true because there I make two instant requests to bring my data and bring my .volt view that I should show in the modal. But then what else can I do I have no idea how to solve my problem: /

edited Apr '17

I posted you ways to solve this problem:

  • use vagrant
  • use docker
  • use php-cgi + apache/nginx instead of apache php module

It's problem related only to windows + apache php module + phalcon, don't ask me why it happens, we can't find reason atm.