Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // This action renders an array of json objects
- procedure TCustomersController.GetCustomers([MVCFromQueryString('rql','')] RQLFilter: String);
- begin
- if RQLFilter.IsEmpty then
- Render<TCustomer>(TMVCActiveRecord.All<TCustomer>)
- else
- Render<TCustomer>(TMVCActiveRecord.SelectRQL<TCustomer>(RQLFilter, 1000));
- end;
- // This action renders a jsonobject containing a property "data" which contains an array of json objects
- procedure TCustomersController.GetCustomers([MVCFromQueryString('rql','')] RQLFilter: String);
- begin
- if RQLFilter.IsEmpty then
- Render(ObjectDict().Add('data', TMVCActiveRecord.All<TCustomer>))
- else
- Render(ObjectDict().Add('data', TMVCActiveRecord.SelectRQL<TCustomer>(RQLFilter, 1000)));
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement