Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

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