Yii3 - How to start

Comparing #18 with #19

Revision #19 was created by rackycz rackycz on Oct 9, 2025, 8:35:16 AM.

edit

Content

[...]
return ExitCode::OK;
}
}
```

Register the new command in file `config/console/commands.php`.

 
 
> You can also obtain the ConnectionInterface in the same way as you did it in `IndexAction` with the `Query` object. Just use `ContainerInterface $container` in the constructor instead of `ConnectionInterface $db`. Then you can call `$db = $this->container->get(ConnectionInterface::class);`.