Cannot add more than one method
Brought to you by:
thaberkern
It is not possible to add more than one method in the
same php Class. Its a little Bug in ajax.php. imho in
line 143 the if:
( !in_array( $method, $this->methods ) )
overrides the class name in the array. I correct it for
my use with:
( !is_array($this->methods[$class]) )
and than it works.
Greetings Joern
mail@joern.info
Logged In: NO
Hi,
Thanks for this fix ...
I´don´t know if this happened to you guys, but after fixing
this bug, it has appeared another one... for me... It was
not recognising the class I was registering... I was
appearing something like: " undefined index '[Classname]' on
bla, bla, bla...";
If not... good for you... but if so... I resolved it with
this code:
(I dont know if it is the best way but it worked)
on AjaxBase.php: LINE: 126 where I had:
<code>
return $reflectionMethod->isStatic();
</code>
Now I have
<code>
if(!array_key_exists ($reflectionClass->getName(),
$this->methods))
{
$this->methods[$reflectionClass->getName()]
= $reflectionClass;
return $reflectionMethod->isStatic();
}
else
{
//return $reflectionMethod->isStatic();
return
$this->methods[$reflectionClass->getName()];
}
</code>
sorry for my english and my poor OOP. If you figure it out
how to do it in a better way.. please post for us ...
Thanks...