Categories > TinyButStrong general >

Accessing Object method In Block

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: Sfortin
Date: 2007-03-15
Time: 03:15

Accessing Object method In Block

Hi!

Today, i was working on accessing a Object Method into a Block section! So i found that is was impossible because of unknow reason!
So i investigate and found the problem!
I patch my copy but I'm writing it here because it might be really great if this could be fixed

So here how i patch my copy :

The problem come from that function -->
function meth_Locator_Replace(&$Txt,&$Loc,&$Value,$SubStart)

The error is here -->
if (method_exists($Value, $x)) {

The problem is that the $x contain an extra ~ in front!
So it should be getUsername for exemple but it cehck ~getUsername

So i patch it like that....
if (method_exists($Value, trim($x,"~"))) {
$x = call_user_func_array(array(&$Value,trim($x,"~")),$ArgLst);
}
That's really ugly but...You might know better than me how to fix it!

So have a nice day!
Thx you!
By: Skrol29
Date: 2007-03-15
Time: 15:42

Re: Accessing Object method In Block

Very thank you for this report.

Can you provide a snippet to repoduce the bug ?