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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T04:20:29+00:00 2026-06-11T04:20:29+00:00

I have a simple controller named AjaxController, <?php class AjaxController extends Zend_Controller_Action { public

  • 0

I have a simple controller named AjaxController,

<?php
    class AjaxController extends Zend_Controller_Action {

    public function init() {
        $params = $this->_getAllParams();
        Zend_Debug::dump($params);
    }

    public function cartAction() {
        $params = $this->_getAllParams();
        Zend_Debug::dump($params);
    }
}

?>

And I am calling this URL – http://example.com/ajax/cart from jQuery like below:

$.post(base_path + "ajax/cart/", { },
 function(data) {
     alert("Data Loaded: " + data);
 });

I get a 404 error (Action not found) when called via jQuery/When I visit the URL directly

I get the following output alone (for the init function):

array(4) {
  ["controller"] => string(4) "ajax"
  ["action"] => string(3) "get"
  ["id"] => string(4) "cart"
  ["module"] => string(7) "default"
}

Here action is “get” and “cart” goes into ID (Just like a Zend Rest Route). Instead, the action name should be “cart”. What is wrong here?

The route works expected, if I add the following route via a ini file:

routes.about.type = "Zend_Controller_Router_Route_Static"
routes.about.route = "ajax/cart"
routes.about.defaults.controller = "ajax"
routes.about.defaults.action = "cart"

But I cannot add routes like this for all my actions in each controller.

I created a test controller to test this.

<?php

Class TestController extends Zend_Controller_Action {

    function indexAction() {
        echo "Index"; exit();
    }

    function testAction() {
        echo "Test"; exit();
    }
}
?>

Only the index action works. Test action does not work (throws EXCEPTION_NO_ACTION exception)

Zend Framework version – 1.12.0

  • 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-11T04:20:31+00:00Added an answer on June 11, 2026 at 4:20 am

    Answering my own question (Actual answer is in the comment by Bas van Dorst)

    There was a Zend_Rest_Route code in the bootstrap, which I forgot to remove from an old code.
    After the removing that code, default routes started working.

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

Sidebar

Related Questions

I'm using CakePhp 2.2 and I have this simple controller, named ProvidersController : <?php
I have a simple Controller that looks like this:- @Controller @RequestMapping(value = /groups) public
I have a simple unsubscribe function in my Unsubscribed controller. if ($this->Unsubscribe->save($this->data['Unsubscribes'])) { //
I have a controller named sales_controller at this controller I got a function in
I have a simple controller specified below, @Controller @RequestMapping(/add/*) public class RequestMappingController { @Autowired
I have simple item model with name and quantity: public class Item extends CouchDbDocument{
I'm stuck with this simple named route problem. I have: #Controller: def show @thing
I have simple front controller plugin which contains this code: http://pastebin.com/m155c59b0 When session expire
I have a folder named public with an controller. There I but all the
THIS IS FIXED, I had named my function the same name as my controller,

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.