title: Error: The view for AppController::index() was not found
body: <p>I am developing a simple application but it throws an error message.</p>
  
  <p><strong>Controller Class:</strong></p>
  
  <pre><code>&lt;?php
  class RegisterController extends AppController
  { 
      public $helpers=array('Html','Form','Session');
      public $components=array('Session');
      public function index(){
      }
      public function register()
          {
          echo "inside fun index inside controller usersform, this function adds data to the database taking values from the registration form\n";
           if( !empty($this-&gt;request-&gt;data ))
              { //pr($this-&amp;gt;request-&amp;gt;data);exit;
           $username=$this-&gt;request-&gt;data['username'];
           $password=$this-&gt;request-&gt;data['password'];
           $email=$this-&gt;request-&gt;data['email'];
           $first_name=$this-&gt;request-&gt;data['first_name'];
           $last_name=$this-&gt;request-&gt;data['last_name'];
           $savedData=array();
           $savedData['usersform']=array( 'username'=&gt;$username,
                                       'password'=&gt;$password,
                                        'email'=&gt;$email,
                                        'first_name'=&gt;$first_name,
                                        'last_name'=&gt;$last_name        
                                      );
              if($this-&gt;usersform-&gt;save($savedData))  
                      { //echo "/ndata is saved in the database";
                       $this-&gt;Session-&gt;setFlash("data is now saved in database, you can now login to your account");
                       $this-&gt;redirect(array('action'=&gt;'login'));
                      }
              else    { $this-&gt;Session-&gt;setFlash("Unable to save data");
                      }
  
              }
          }
      public function login()
      {
          echo "inside func login inside controller usersform, this func would check name an password that the usersform has filled and match it against database records";
  
          if(!empty($this-&gt;request-&gt;data)){
              $username=$this-&gt;request-&gt;data['username'];
              $password=$this-&gt;request-&gt;data['password'];
              $searchData=$this-&gt;Teacher-&gt;find('first',array('conditions'=&gt;array('username'=&gt;$username, 'password'=&gt;$password)));
          //echo '&amp;lt;pre&amp;gt;';
          //pr($searchData);exit;
              if(empty($searchData))
              {
                  //$message = 'Not Found';
                  $this-&gt;Session-&gt;setFlash("could not find data matching ur login details");
              }
              else
              {
                  //$message = 'Login Successfully';
                  $this-&gt;Session-&gt;write('username',$username);
                  $this-&gt;Session-&gt;setFlash("congrats, you have successfully logged in");
                  $this-&gt;redirect(array('controller'=&gt; 'usersform', 'action'=&gt;'welcome'));
              }
          }
  
      }
        public function welcome()
          {   echo "inside the welcome func inside teachers controller";
              echo $this-&gt;Session-&gt;read('username');
          // $this-&amp;gt;Session-&amp;gt;setFlash("welcome to your account" .$username);
          }
  }
  ?&gt;
  </code></pre>
  
  <p><strong>Model class:</strong></p>
  
  <pre><code> &lt;?php
      class usersform extends AppModel
      {
  
      }
  
      ?&gt;
  </code></pre>
  
  <p><strong>View Class:</strong></p>
  
  <pre><code>&lt;form action="&lt;?php echo $this-&gt;html-&gt;url(array('controller'=&gt;'Teachers', 'action'=&gt;'index')); ?&gt;" method="POST"&gt;
  Username:&lt;input type="text" name="username" size="30"&gt;
  password:&lt;input type="password" name="password" size="30"&gt;
  email:&lt;input type="text" name="email" size="10"&gt;
  First_Name:&lt;input type="text" name="First_Name" size="30"&gt;
  Last_Name:&lt;input type="text" name="Last_Name" size="30"&gt;
  &lt;input type="submit" name="submit" size="15"&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>It throws an error message like this:</p>
  
  <blockquote>
    <p>Missing View
    Error: The view for AppController::index() was not found.
    Error: Confirm you have created the file: D:\xampp\htdocs\project\UserRegisterForm\app\View\App\index.ctp</p>
  </blockquote>