Prefixing each GET parameter with component name sucks
- meridius
- Member | 34
I have a component with handle function:
public function handleBadgeSearch($q, $page, $badgeType) {
/* some code */
}
to serve AJAX requests from presenter's template js code:
select.show().select2({
tags: true,
ajax: {
delay: 250,
cache: true,
url: {link autocompleteComponent:badgeSearch!},
data: function(params) {
return { {* FIXME prefixing each GET parameter with component name sucks! *}
"autocompleteComponent-q": params.term,
"autocompleteComponent-page": params.page,
"autocompleteComponent-badgeType": badgeType
};
},
processResults: function(data, page) {
return {
results: data.items
};
}
}
});
I can't get to any of the GET parameters unless I prefix them with
component name.
This gets more complicated with every added (nested) layer of component
demanding its prefix.
Is there any other way?
Last edited by meridius (31. 10. 2015 20:12)
RSS feed
Topic closed