title: Yii Module code generation problems using Gii
body: <p>I have just used Gii to generate a new module called gig. After generating the module code with Gii, I updated the config/main.php file to include the 'gig' module as follows:</p>
  
  <pre><code>'import'=&gt;array(
      'application.models.*',
      'application.components.*',
      'application.modules.*',
  ),
  
  'modules'=&gt;array(
      // uncomment the following to enable the Gii tool
  
      'gii'=&gt;array(
          'class'=&gt;'system.gii.GiiModule',
          'password'=&gt;'secretpassword',
      ),
      'gig',
  ),
  </code></pre>
  
  <p>Now, when I try to access the auto-generated Yii module code in my browser as follows:</p>
  
  <p><a href="http://localhost/gig/default/index/" rel="nofollow noreferrer">http://localhost/gig/default/index/</a></p>
  
  <p>I receive the following error:</p>
  
  <p>DefaultController cannot find the requested view "index".</p>
  
  <p>To fix this problem, I changed the render code in the module's DefaultController.php from this:</p>
  
  <pre><code>$this-&gt;render('index');
  </code></pre>
  
  <p>to this:</p>
  
  <pre><code>$this-&gt;render('gig.views.default.index');
  </code></pre>
  
  <p>This change resolved the problem, but I am wondering if I have missed something or if Gii is generating buggy code for modules?  Anybody experience this problem before?  Is my solution correct?</p>
  
  <p>Now that the controller can find the view, I reloaded the page, only to be shown this error message:</p>
  
  <p>Trying to get property of non-object </p>
  
  <p>Turns out that there is a problem with the following code in the index.php view file:</p>
  
  <pre><code>$this-&gt;breadcrumbs=array(
      $this-&gt;module-&gt;id,
  );
  </code></pre>
  
  <p>I am not sure why this is happening.  I tried changing the above code to the following:</p>
  
  <pre><code>$this-&gt;breadcrumbs=array(
      Yii::app()-&gt;controller-&gt;module-&gt;id,
  );
  </code></pre>
  
  <p>but this still gives me the same error message, "Trying to get property of non-object". </p>
  
  <p>Any idea what may be wrong?  Am I missing something when setting up the module code?  I am using Yii 1.1.7</p>
  
  <p>Thanks!</p>