Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6087583
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T11:53:12+00:00 2026-05-23T11:53:12+00:00

I have just used Gii to generate a new module called gig. After generating

  • 0

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:

'import'=>array(
    'application.models.*',
    'application.components.*',
    'application.modules.*',
),

'modules'=>array(
    // uncomment the following to enable the Gii tool

    'gii'=>array(
        'class'=>'system.gii.GiiModule',
        'password'=>'secretpassword',
    ),
    'gig',
),

Now, when I try to access the auto-generated Yii module code in my browser as follows:

http://localhost/gig/default/index/

I receive the following error:

DefaultController cannot find the requested view “index”.

To fix this problem, I changed the render code in the module’s DefaultController.php from this:

$this->render('index');

to this:

$this->render('gig.views.default.index');

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?

Now that the controller can find the view, I reloaded the page, only to be shown this error message:

Trying to get property of non-object

Turns out that there is a problem with the following code in the index.php view file:

$this->breadcrumbs=array(
    $this->module->id,
);

I am not sure why this is happening. I tried changing the above code to the following:

$this->breadcrumbs=array(
    Yii::app()->controller->module->id,
);

but this still gives me the same error message, “Trying to get property of non-object”.

Any idea what may be wrong? Am I missing something when setting up the module code? I am using Yii 1.1.7

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T11:53:13+00:00Added an answer on May 23, 2026 at 11:53 am

    Sorry, it was our own stupid mistake. One of our programmers added a __construct method to the Controller class and forgot to include the $module variable in that method as follows:

    public function __construct($id='site')
    {
        parent::__construct($id);
    
        //custom code here
    }
    

    After adding $module variable as shown below, everything works fine now.

    public function __construct($id='site', $module = null)
    {
       parent::__construct($id, $module);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm re-acquainting myself with Perl, and have just used module-starter to initialise a new
Why is there another section called connectionStrings? I have always just used appSettings, until
I have just taken over some code and I see this used a lot.
I have just used org.apache.openjpa.persistence.meta.AnnotationProcessor6 to generate the MetaModel for my JPA2 entities. @javax.annotation.Generated
Mostly I have just used XML files to store config info and to provide
To localitie items in the standard directories, I have just used either one of
I have used just Windows for programming so far. Now, I have an internship
I have just downloaded SQL Server 2005 express edition from here: To be used
Just trying to understand that - I have never used it before. How is
I have a correlated subquery in an update that used to work just fine

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.