Difficulty excluding fields from data returned by introspector methods
-
Hi there
Great plugin.
I am writing a custom controller, and want to only include/exclude certain data from the data returned, such as excluding the ‘author’ info.
I have got my custom controller working, and I am trying the following
return $json_api->introspector->get_posts();
which works fine and returns all the posts data as JSON.
However, I want to exclude the ‘author’ info, and am modifiying the above code to be:
return $json_api->introspector->get_posts(array(‘exclude’ => ‘author’));
However, it doesn’t work, returning all the same fields again.
Also, if I try any basic statements like the following, I also don’t get a subset of the posts data:
return $json_api->introspector->get_posts(array(‘exclude’ => ‘title_plain’));
return $json_api->introspector->get_posts(array(‘include’ => ‘title_plain’));
return $json_api->introspector->get_posts(array(‘query’ => ‘include=title_plain’));What am I missing? I’ve tried so many combinations maybe I’ve missed something simple.
Does the ‘core’ controller need to be activated at all? Whether it is or not seems to make no difference.
If anyone could help I’d greatly appreciate it.
Cheers
Matt
- The topic ‘Difficulty excluding fields from data returned by introspector methods’ is closed to new replies.