title: Custom action in controller not working in yii2
body: <p>I have controller called RegisterController and index view. If I submit the form, its showing the <strong>page not found (404) error</strong>. In the same if I change the method to <strong>actionCreate instead of actionAddBasic</strong>, working fine. Please help me to resolve the issue. Thanks.</p>
  
  <p><strong>RegisterController.php</strong></p>
  
  <pre><code>&lt;?php    
  namespace app\controllers;
  
  use app\models\Address;
  use yii;
  use yii\filters\AccessControl;
  use yii\web\Controller;
  use yii\filters\VerbFilter;
  use app\models\BasicInfo;
  use app\models\User;    
  
  /**
   * Class RegisterController
   * To Handle Registration Related Requests.
   */
  class RegisterController extends Controller
  {
       public function behaviors()
      {
          return [
             'access' =&gt; [
                  'class' =&gt; AccessControl::className(),
                  'only' =&gt; ['addBasic'],
                  'rules' =&gt; [
                      [
                          'actions' =&gt; ['addBasic'],
                          'allow' =&gt; true,
                          'roles' =&gt; ['?'],
                      ],
                  ],
              ],
              'verbs' =&gt; [
                  'class' =&gt; VerbFilter::className(),
                  'actions' =&gt; [
                      'addBasic' =&gt; ['post'],
                  ],
              ],
          ];
      }
  
  
      /**
       * To Load Registration Page.
       */
      public function actionIndex()
      {
          $user = new User();
          $basicInfo = new BasicInfo();
          $basicInfo-&gt;gender = 1;
          $fileUpload = new FileUpload();
          $addressModel = new Address();
          return $this-&gt;render('index', [
              'userModel' =&gt; $user,
              'basicInfoModel' =&gt; $basicInfo,
              'fileUploadModel' =&gt; $fileUpload,
              'addressModel' =&gt; $addressModel
          ]);
      }
  
      public function actionAddBasic()
      {
          yii::trace('Inside AddBasic');
          return $this-&gt;render('index', [
              'userModel' =&gt; new User(),
              'basicInfoModel' =&gt; new BasicInfo(),
              'fileUploadModel' =&gt; new FileUpload(),
              'addressModel' =&gt; new Address()
          ]);
      }
  
  }
  </code></pre>
  
  <p><strong>register/index.php:</strong></p>
  
  <pre><code>    &lt;?php
      use yii\helpers\Html;
      use yii\helpers\ArrayHelper;
      use yii\widgets\ActiveForm;
      use app\models\MaritalStatus;
      use app\models\ProfileFor;
  
      ?&gt;
      &lt;div class="form"&gt;
          &lt;?php $form = ActiveForm::begin(['id' =&gt; 'form-signup-1', 'action' =&gt; ['index.php/register/addBasic']]); ?&gt;
  
                      &lt;div class="row"&gt;
                          &lt;?= $form-&gt;field($basicInfoModel, 'name')-&gt;textInput(['maxlength' =&gt; 25, 'placeholder' =&gt; 'Name']) ?&gt;
                      &lt;/div&gt;
                      &lt;div class="row"&gt;
                          &lt;?= $form-&gt;field($userModel, 'email')-&gt;input('email', ['maxlength' =&gt; 30, 'placeholder' =&gt; 'Email']) ?&gt;
                      &lt;/div&gt;
                      &lt;div class="row"&gt;
                          &lt;?= $form-&gt;field($userModel, 'mno')-&gt;input('text', ['maxlength' =&gt; 10, 'placeholder' =&gt; 'Mobile Number']) ?&gt;
                      &lt;/div&gt;  
  &lt;div class="row" style="float: right;"&gt;
                      &lt;?= Html::submitButton('Create', ['class' =&gt; 'btn btn-success']) ?&gt;
                      &lt;?= Html::resetButton('Reset', ['class' =&gt; 'btn btn-success']) ?&gt;
                  &lt;/div&gt;             
          &lt;?php ActiveForm::end(); ?&gt;
      &lt;/div&gt;
  </code></pre>