Re: HTML_AJAX, QuickForm_Livesearch and magic methods
| From: | Joshua Eichorn | Date: | Mon, 26 Jun 2006 16:51:00 +0000 |
| Subject: | Re: HTML_AJAX, QuickForm_Livesearch and magic methods | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-43115@lists.php.net to get a copy of this message | ||
thesee@fastwebnet.it wrote:
Hi all. I'm extensively testing and using HTML_QuickForm_Livesearch. The integration with HTML_AJAX works good. But in the normal use there is a limit. I dont know if its a my fault... I'm trying to set a large number of livesearch elements in a form. It work great. Every element has an id which is used as target. Every id call a method of a class 'livesearch.class.php' (as you can see on the example in HTML_AJAX or QF_Ls release) The problem is: When I have a large number of elements, i must set for each element an unique id. for each id (target) there is a method on the php livesearch class. So if i have 100 element and every element do the same search search(methods) i must write down 100 equal methods. so, I'm working with PHP5...well.....can I use magic methods? __call __get? I tryed it but seem that the AJAX class ignore this magics methods. Some tips? Thank you very much Regards Giuseppe Dessì For security purposes HTML_AJAX only allows calls to registered methods on a class. There is no introspection for magic methods, so they can't be autodetected and registered.You should be able to pass all the methods into the registerClass call though and have things work (I haven't tested that, but if it doesn't file a bug and will get it fixed) -josh