-
Notifications
You must be signed in to change notification settings - Fork 36
Description
Numerous periods (".") are missing from the README. For example, 3 periods are missing in the section on phery.remote():
Calls an AJAX function directly, without binding to any existing elements, the DOM element is created and removed on-the-fly If directCall is false, it will return a jQuery a element, if not, it will return an jqXHR object
function_name: string, name of the alias defined in Phery::instance()->set() inside PHP args: object or array or variable, the best practice is to pass an object, since it can be easily accessed later through PHP, but any kind of parameter can be passed, from strings, ints, floats, and can also be null (won't be passed through ajax) attr: object, set any additional information about the DOM element, usually for setting another href to it. eg: {href: '/some/other/url?p=1'} direct_call: boolean, defaults to true, setting this to false, will return the created DOM element (invisible to the user) and can have events bound to it, but will be removed right after the response is processedphery .remote('remote', {'key':'value'}, {'href': '/new/url'}, false) .on({ 'phery:done': function(){ $('body').append($(this)); } }) .phery('remote');When setting direct_call to false, the returned element can be reused many times, using phery('remote'), to explicitly remove it, you need to call phery('remove')
If you wish to remove it as soon as the call ends, pass in the attr parameter, the temp option:
> phery.remote('remote', {'id': 1}, {'temp': true}, false).phery('remote');If direct_call is undefined or true (the default) the element is removed and cleaned after each remote call.
There should be periods:
Before "If directCall"
After "jqXHR object"
After "to call phery('remove')"