I am using the latest stable version 1.18.

I have read the tutorials from chris about his xml webservice and
cakephp. I can't seem to get this work. I am trying to make a json
service. I am trying to figure out what I did wrong.

my controller: /app/controllers/news_controller.php
class NewsController extends AppController {
   var $name = 'News';
   var $component = array('json');

   function index() {
      $this->set('message', 'test');
   }
}

/app/controllers/components/json.php
<?php
class JSONComponent extends Object {
}
?>

/app/views/helpers/json.php
<?php
class JsonHelper extends Helper {
}
?>

then i also created the default layout /views/layout/json/
default.thtml
<?= $content_for_layout ?>

finally i added a view page at /views/news/json/index.thtml
<?php
echo $message;
?>

Result: I typed in my address /json/news/index/
Missing controller

You are seeing this error because controller JsonController could not
be found.

Notice: If you want to customize this error message, create app/views/
errors/missing_controller.thtml.

Fatal: Create the class below in file : app/controllers/
json_controller.php

<?php
class JsonController extends AppController {
   var $name = 'Json';
}
?>

Any advice on what I did wrong?

If this doesnt work, I am going to just make a new action for each
item called json.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to