Open Chealer opened 8 years ago
Yes, the AJAX function (the one specified on the client side) is the key of the array. The callback is the value of the array. There are many ways you can call an user function in PHP, I tried to show what is possible that will work with the set
function.
Sorry about the english part, my native language is brazilian portuguese, sometimes I find it hard to find equivalents in english.
Yes, the examples are very useful but this method is of high importance and should be well specified too. I recommend replacing the term "function" with either "callback" or "callable" (used in the PHP manual).
You have nothing to be sorry about; English is non-trivial, and only a few are lucky enough to speak it natively.
The documentation for Phery::set() reads:
Which ajax call this refers to is unclear. The description of $functions suggests the elements should be functions, but that is not always the case, as seen in the first 3 elements. This also fails to specify that the array must be string-indexed. This is mentioned in the README's take on that function, which uses the synopsis "Phery::instance()->set(array $functions)":
I do not know what the last sentence was meant to read, but it is invalid as it stands. Either a whole comprises parts, or a whole is comprised of parts. x cannot "comprise of" y. French has 2 distinct verbs for that ("est constitué de" vs "comprend").