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 8823333
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T06:19:41+00:00 2026-06-14T06:19:41+00:00

Trying to use modules in Yii and want to get access from main controller

  • 0

Trying to use modules in Yii and want to get access from main controller (SiteController) for module’s methods.
Create module with Gii, module name is Car.
Trying get access to method search in RequestController, module Car.

echo Yii::app()->Car->Request->search();

And Yii talks me

Property “CWebApplication.carhire” is not defined.

Does anybody knows how to get access to module’s methods from another controllers?
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-06-14T06:19:43+00:00Added an answer on June 14, 2026 at 6:19 am

    Your modules don’t get put into the application scope. That is components that can be accessed via Yii::app()-> modules however are accessed via Yii::app()->getModule($moduleName)->.

    This doesn’t really help running an action on a controller though. It’s difficult to get access too without entirely breaking the point of abstracting the module.

    bool.dev’s answer Here is the best methods i’ve seen if you really need too.

    But the problem your having is likely pointing to an underlying problem with the structure of your site. If you need access to a module controller function somewhere else in your app, maybe it shouldn’t be in the module?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to use python's telnetlib module to get information from a remote
I'm trying to use Asp.NET WebAPI module but I get a weird error. When
So, I'm trying to use the Python Wave module to get an audio file
I'm trying to use php to get the list of loaded apache modules using
I've been trying to use the zipfile and shutil.make_archive modules to recursively create a
i am trying to use Groovy WS and use the following code. @Grab(group='org.codehaus.groovy.modules', module='groovyws',
I'm trying to use modules in the ZF 1.8 project but can't get working
I'm trying to use forms with modules, they should be stored inside the module.
I'm trying to use Twitter's Bootstrap css and js modules. Specifically, the twipsy module,
I'm trying to use declarative caching from the Spring Modules project. It's not working

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.