Problem with model manager

Hi,

I have a problem with my modelsManager, when I try this code in my controller :

$phql = "select * from TABLE"; $action = $this->modelsManager->executeQuery($phql);

I get this error : "Using $this when not in object context".. It's like modelsManager is not recognised at all.

In my configuration, I have a Micro class that I instantiate in my index.php and that contains :

$di->set('modelsManager', function() { return new \Phalcon\Mvc\Model\Manager(); });

I also tried "$app->modelsManager", it is still the same error and var_dump($app) equals to NULL.

Any ideas ?

Thanks for your help.



36.4k

Hi

You can upload code on github. I will help make you problem that