Hi all,

I tried to follow this tutorial to do REST web services.

Below are my code.

CONFIG/ROUTES.PHP
        Router::mapResources('recipes');
        Router::parseExtensions('xml'); // it doesn't make a difference
whether i include 'xml' or not

MODEL
<?php
class Recipe extends AppModel {
        var $name = 'Recipe';
}
?>

VIEW //views/recipes/xml/index.ctp

<recipes>
        <?php echo $xml->serialize($recipes); ?>
</recipes>



CONTROLLER
<?php
class RecipesController extends AppController {

        var $name = 'Recipes';
    var $components = array('RequestHandler');
        var $helpers =array('Xml');

        function index() {

                $recipes = $this->Recipe->find('all');
                $this->set(compact('recipes'));


                // $this->Recipe->recursive = 0;
                // $this->set('recipes', $this->paginate());
        }

}
?>

However, the xml is not rendered. But when i view source, it is there.
Is there a problem?
I test it on firefox, chrome and safari on macosx 10.6

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" 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