title: yii2 how to run console controller function
body: <p>I'm stuck. I'm trying to run some function from the command shell.
  I'm using the HelloController from the basic project.
  When I run <code>php yii hello</code> it's working good and the index function is running but if I try to run different function like <code>php yii hello/create</code> I'm getting this error -</p>
  
  <blockquote>
    <p>Error: Unknown command.</p>
  </blockquote>
  
  <p>I added the create function to this controller.
  The strange thing is that when I run <code>php yii</code> I'm seeing the create command.
  My controller code </p>
  
  <pre><code>namespace app\commands;
  
  use yii\console\Controller;
  use Yii;
  
  class HelloController extends Controller
  {
  
      public function actionIndex($message = 'hello world')
      {
          echo $message . "\n";
      }
      public function actionCreate($message = 'hello world')
      {
          echo $message . "\n";
      }
  
  }
  </code></pre>
  
  <p><strong>UPDATED:</strong>
  My Config file is</p>
  
  <pre><code>Yii::setAlias('@tests', dirname(__DIR__) . '/tests');
  
  $params = require(__DIR__ . '/params.php');
  $db = require(__DIR__ . '/db.php');
  
  return [
      'id' =&gt; 'basic-console',
      'basePath' =&gt; dirname(__DIR__),
      'bootstrap' =&gt; ['log', 'gii'],
      'controllerNamespace' =&gt; 'app\commands',
      'modules' =&gt; [
          'gii' =&gt; 'yii\gii\Module',
      ],
      'components' =&gt; [
  
        'mailer' =&gt; [
              'class' =&gt; 'yii\swiftmailer\Mailer',
              'viewPath' =&gt; '@app/mail',
              // send all mails to a file by default. You have to set
              // 'useFileTransport' to false and configure a transport
              // for the mailer to send real emails.
              'useFileTransport' =&gt; false,
              'transport' =&gt; [
          'class' =&gt; 'Swift_SmtpTransport',
          'host' =&gt; '...',
          'username' =&gt; '...',
          'password' =&gt; '...',
          'port' =&gt; '...',
          //'encryption' =&gt; 'tls',
        ],
  
          ],
  
          'cache' =&gt; [
              'class' =&gt; 'yii\caching\FileCache',
          ],
           'authManager' =&gt; [
              'class' =&gt; 'yii\rbac\DbManager',
          ],
  
          'log' =&gt; [
              'targets' =&gt; [
                  [
                      'class' =&gt; 'yii\log\FileTarget',
                      'levels' =&gt; ['error', 'warning'],
                  ],
              ],
          ],
          'db' =&gt; $db,
  
  
      ],
      'params' =&gt; $params,
  ];
  </code></pre>
  
  <p>Does anyone know how to solve this issue?
  Thanks.</p>