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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T06:53:04+00:00 2026-05-25T06:53:04+00:00

I would like to handle a missing action in one of my controllers in

  • 0

I would like to handle a missing action in one of my controllers in a default action. Now the default behavior is to throw an error. I would like to be able to have a default action in that controller that is called and passed the name of the action requested so I may do something with it. Now I know you can change the whole missing action page which is not what I am looking to do. Any incite on this would be great, if its not possible please let me know.

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-25T06:53:05+00:00Added an answer on May 25, 2026 at 6:53 am

    Depending on how much of an exception to your normal actions this is, a change in routing may make more sense:

    Router::connect('/mycontroller/*',
                    array('controller' => 'mycontroller', 'action' => 'catchall'));
    

    If you have some normal actions in that controller, define a route for them before this catch-all route to have them handled normally.

    If you really want to futz around with the action handling in the controller itself, you should be able to do so in beforeFilter:

    public function beforeFilter() {
        if (!method_exists($this, $this->action)) {
            unshift($this->params['pass'], $this->action);
            $this->action = 'catchall';
        }
    }
    

    Something like that at least, that’s just a quick untested idea.

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

Sidebar

Related Questions

I have a list of elements I would like to be able to have
I would like to handle a return result from an AsyncTask outside of the
I would like to handle the case where I don't like the format of
I would like to handle a button clicked event in a native c++ class.
I would like to understand whats the best way to handle exceptions in Multicast
I would like to deploy snapshot builds from Bamboo to Artifactory. My repository's Handle
Ok I really would like to know how expert MVVM developers handle an openfile
I would like to call the event handler just one time, and then detach
I have an UserControl and would like to hide the resizing handles in design-time,
I would like use data annotations to handle validation in my Silverlight app. The

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.