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

  • Home
  • SEARCH
  • 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 3315176
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T22:19:10+00:00 2026-05-17T22:19:10+00:00

I have an controller that has actions that are set up using chained. My

  • 0

I have an controller that has actions that are set up using chained. My chained root action is in my root controller, then my ‘section’ controller has a ‘root’ action chained from the root controller’s ‘root’ action. I then have endpoint actions in the ‘section’ controller class that chain from the ‘root’ action in the same class:

 package MyApp::Controller::Root;

 sub root :Chained('/') PathPart('') CaptureArgs(0) {}

 package MyApp::Controller::Section;

 sub root :Chained('/root') PathPrefix CaptureArgs(0) {}

 sub foo :Chained('root') PathPart Args(0) {}

How can I disable the all the actions in the ‘section’ package via a config file? What I have done so far is make the ‘root’ action in the section class Private and that seems to work, but how can I tell that the section is not available when I build by navigation? I can try uri_for_action and that returns undef, but that seems a bit messy and it does raise a warning that Catalyst cannot find the uri_for for the action.

  • 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-17T22:19:10+00:00Added an answer on May 17, 2026 at 10:19 pm

    You should be able to introspect the currently dispatched action via

    my $action = $ctx->action;
    

    And since the action objects carry their attributes, you can check for a true value on one in your base chain call:

    sub root: Chained PathPart('') CaptureArgs(0) {
        my ($self, $ctx) = @_;
        $ctx->dispatch('/your/action/handling/this/error')
            if $ctx->action->attributes->{Disabled};
    }
    

    Then you can configure it in your config like described in http://search.cpan.org/dist/Catalyst-Runtime/lib/Catalyst/Controller.pm#action (using config::General syntax here):

    <controller Foo>
        <action "you_want_to_disable_this">
            Disable 1
        </action>
    </controller>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using the Zend Framework. I have a controller named 'UserController' that has
Using Rails v2.1, lets say you have an action for a controller that is
If I have an ASP.NET MVC controller action that is called from a jQuery
I have a Rails application that unfortunately after a request to a controller, has
I have a controller action that is being executed by a link that was
I have multiple controller actions that takes an id public ActionResult Get(int? id) {
I have a HTML form, and I have a Controller Action that accepts the
I have an winforms application that was built using MVC. The controller is subscribing
I would like to set up a route for a controller that has the
I have a post controller that has many comments. The post model has a

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.