Run console command from another one

How do I run a console controller action from another console controller action?

I’ve tried the following


class FooController extends Controller

{

    public function actionBar()

    {

        $this->run('baz/quux', ['baz'=>'quux']);

    }

}


class BazController extends Controller

{

    public function actionQuux($baz)

    {

        // ...

    }

}

I’m getting an error

Though the quux action of the baz controller has the baz parameter and running

succeeds.

I don’t mean to specify an option, I don’t even use options. I want to specify the action’s parameter. What should be the format of the parameters array?

It turns out that the parameters array should not contain parameter keys… It should look like this


$this->run('baz/quux', ['quux']);