[FLOW3-general] Ajaxable Actions / JSON as content-type

David Schoen david-schoen at gmx.de
Tue Sep 20 00:18:50 CEST 2011


Hi Christian,

thanks for the tip. The routing-configuration did the trick and is 
powerful enough to make me completely happy :) So my previous request 
would be "nice to have" ;)

Best regards,
David


Am 19.09.11 10:37, schrieb "Christian Müller (Kitsunet)":
>
> On 19/09/11 01:16, David Schoen wrote:
>
>>
>> 1. If I use exactly the lines you provided with a call from jQuery I
>> won't get Json but html. My guess is that's because jQuery sets the
>> header "Accept: application/json, text/javascript, */*; q=0.01". I'm not
>> able to tell jQuery to use just "Accept: application/json". Shouldn't
>> the controller choose the JsonView if the content-type is
>> "application/json" and the accept-header like above? Otherwise nobody
>> could use the JsonView with a jQuery.getJson-request and that would be
>> sad :)
>>
>
> Hi David,
>
> take a look at the routing. You can define the format there (just use
> two routes, one for html one for json), that should force it.
>
> Christian



More information about the FLOW3-general mailing list