Hi all,

I'm doing a little experimentation with cake.  I have a very basic app
(user registration/log on/blog posts) and I'd like to write a simple
API plugin for it.  So when I got to <site>/api/posts/<method> it
would direct me to <Plugin>/Api/...  I have the plugin created and
when i navigate to the api pages the appropriate controller methods
are being invoked and the view is displayed.

What I'd like to know is how to use one of my main app models to query
data from the database?  A simple example would be how do i do a $this-
>Post->find('list') from an unrelated controller?  I've tried to
instantiating the Post objects themselves via $post = new Post() but I
get a class not found error.  My goal would be to return all the posts
to the view and do something like <?php echo $xml->serialize($posts); ?
>

This was my inspiration and I'm trying to take it a step further:
http://quinnsupplee.com/blog/quinn/02-11-2010/create-rest-style-api-cakephp-and-xml

This might seem silly but I'm just trying to see what I can do with
cake.  Eventually I'd like to apply this api concept to a much larger
idea.  Also, if I'm going about this completely the wrong way feel
free to point that out...

Thanks!

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php

Reply via email to