Closed blaasvaer closed 6 years ago
@blaasvaer Since id is most useful it's actualy implemented right into schemas
schema.setGet(function ($) {
// $.controller.id contains a value of the first argument of dynamic routing
$.controller.id;
...
another way is
...
ROUTE('/admin/api/pages/{id}', json_query, ['*Pages']);
...
function json_query ( id ) {
if ( id ) {
// pass id as a helper and use it in schema as $.options
_this.$get(id, this.callback() );
}
}
...
model
schema.setGet(function ($) {
$.options // the id
});
Thanks.
Can someone explain to me how I can access parameters from a model, passed to a route with AJAX?
I have this in the client:
And this in the controller:
And this in the model:
Whatever I try, I get no closer than this: