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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 19, 20262026-06-19T03:47:20+00:00 2026-06-19T03:47:20+00:00

Hello, my code is not working in CakePHP framework and it is showing an

  • 0

Hello, my code is not working in CakePHP framework and it is showing an error message.

URL:

http://domainname.com/About/param1/param2

Code:

class AboutController extends AppController {

    public $name = 'About';
    public $helpers = array('Html');

    public function index($arg1, $arg2)
    {
        print_r($this->request->params['pass']);
        $this->set('title_for_layout','Sarasavi Bookshop - About Sarasavi Bookshop');
        $this->set('nameforfiles','about');
    }
}

Error message:

Missing Method in AboutController    
Error: The action param1 is not defined in controller AboutController
Error: Create AboutController::param1() in file: app\Controller\AboutController.php.

<?php
class AboutController extends AppController {


    public function param1() {

    }

}

Notice: If you want to customize this error message, create app\View\Errors\missing_action.ctp

After creating the function param1 I can get param2, But I need to get param1 and param2 both, in index function without create another action.

Please help me,
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-19T03:47:21+00:00Added an answer on June 19, 2026 at 3:47 am

    Your original code would work if you went to http://domainname.com/About/index/param1/param2

    If you don’t want the index in the url, as I assume you don’t, then you need to define a route.

    Add this to your routes:

    Router::connect(
        '/About/*',
        array('controller' => 'About', 'action' => 'index')
    );
    

    to automatically route requests that don’t specify an action but do have params to go to your index action. You will need to add a route for any new About actions to stop requests for them from going to index by default though.

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

Sidebar

Related Questions

I have this code $(.myclass).on(click, function(e){ alert('Hello'); }); Now its not working on dynamicaly
foo\r\nbar.replace(/(foo).+/m, bar) Hello. I can not understand why this code does not replace foo
Hello everyone don't know why this code works on windows but not on linux
Technology Used:- Asp.Net 2.0 Code:- See Below Description:- hello code given below is working
fopen function is not working in php. I wrote the following code in my
I have the following PHP code, but it's not working. I don't see any
Hello Everyone, [Error: objc-class-ref in ViewController.o ld: symbol(s) not found for architecture i386 clang:
This is my code so far... needless to say, it's not working :( $feed
I've done this a month before... But now its not working... The code is
why my code is not working here I think I made something wrong but

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.