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

Pass parameters via controller to a DI container

DI set

$di->set('getparameter',function($param1,$param2) {


in controller

$this->di->get('getparameter', $param1,$param2 );

The problem is am getting the following error;

    BadMethodCallException: Wrong number of parameters


I managed to quickly solve after posting here;

$this->di->get('getparameter', array($param1,$param2 ) );

Worked for me