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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T01:43:53+00:00 2026-06-03T01:43:53+00:00

I am following this tutorial http://book.cakephp.org/2.0/en/development/rest.html to get up and running with REST in

  • 0

I am following this tutorial http://book.cakephp.org/2.0/en/development/rest.html to get up and running with REST in my CakePHP application.

I have added the following to my routes.php file:

Router::mapResources(array('fantasyPicks', 'fantasyPlayers'));
Router::parseExtensions();

In each of my controllers, I have included the RequestHandler component and also setContent to json in the beforeFilter() callback. It looks something like this:

class FantasyPicksController extends AppController {
public $components = array('RequestHandler');

public function beforeFilter() {
    parent::beforeFilter();
    $this->RequestHandler->setContent('json','text/x-json');
    $this->layout = 'json/default';
}

public function index() {
    $fantasyPicks = $this->FantasyPick->find('all');
    $this->set('json', $fantasyPicks);
    $this->render('/json/data');
}
...

My json/data view simply echos json_encode:

<?php echo json_encode($json); ?>

After all of this, navigating to /fantasyPicks/view/1 works as expected. However, /fantasyPicks/1 is giving me the following error:

Missing Method in FantasyPicksController
Error: The action 1 is not defined in controller FantasyPicksController

Error: Create FantasyPicksController::1() in file: app\Controller\FantasyPicksController.php.

<?php
class FantasyPicksController extends AppController {

    public function 1() {

    }

}

Does anyone know what I am doing incorrectly? Any help is appreciated!

  • 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-03T01:43:54+00:00Added an answer on June 3, 2026 at 1:43 am

    You have to use proper controller naming conventions when accessing the page.

    http://book.cakephp.org/2.0/en/getting-started/cakephp-conventions.html

    Refer to the URL considerations section. So you should be going to /fantasy_picks/1 and it will work properly.

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

Sidebar

Related Questions

I've been following this tutorial http://book.cakephp.org/2.0/en/development/rest.html for restful web services integration with cakephp over
I'm new to cakephp and following this tutorial. http://book.cakephp.org/2.0/en/tutorials-and-examples/blog-auth-example/auth.html I have created the blog
We started following the CakePHP Blog tutorial hosted on the website cakephp.org - http://book.cakephp.org/2.0/en/tutorials-and-examples/blog/part-two.html
I have been learning RESTful webservices following this tutorial http://www.vogella.de/articles/REST/article.html . As I understand,
I'm following the Auth tutorial and in this stage http://book.cakephp.org/view/1547/Acts-As-a-Requester aros table is not
Following this tutorial http://netbeans.org/kb/docs/javaee/maven-osgiservice-cdi.html I have managed to create a simple OSGI bundle and
I'm following this tutorial: http://developer.android.com/resources/tutorials/views/hello-datepicker.html . I have two EditText, and which one calls
Hi i am following this tutorial http://www.vogella.de/articles/AndroidGestures/article.html i want to create an application in
I'm following this tutorial http://ruby.railstutorial.org/ruby-on-rails-tutorial-book My question is, what is the relation for user
I am new to Rails & Ruby and have been following the http://ruby.railstutorial.org/ruby-on-rails-tutorial-book and

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.