AbraCadaver wrote:cone13cone wrote:AbraCadaver wrote:As for your example, there is no way to do this. Function variables are local to that function. I think you may have a fundamental design flaw.
There is a way: its to pass __METHOD__ and func_get_args() as arguments to the wrapper method. Was just trying to find the easiest way.
Uhh, yeah... But you said you wanted wrap_this() to return those. I guess I thought that it would be really stupid to pass vars to a function just so that function could return the vars straight back. If all you want to do is set the vars to a class var, then why not just set them in the respective functions?
Without knowing what you're trying to accomplish from a high level, advice is limited.
Sorry if you misunderstood my goal was not to pass them right back, but to wrap the result as shown below.
My ultimate goal is to wrap what is returned from my db with handles to that class and method:
So in this example get_invoices would return
<div class = 'eup_invoice' data-class='Invoice' data-method='get_hours' data-id='1029'> value returned from get_hours</div>
when I need to update the text node without refresh, i can net the data-(HTML 5 I know) attribute and pass them to an ajax updater function which would call something like below.
$updatedNode = new $_GET['class'];
$updatedNode -> $_GET['method']();
The problem is I have about 50 methods that I need to "map" and wrap around their own value, I could always just wrap them inside each method, but I believe their has to be a better way to do it, would seem like an immense amount of repetition.
Hope this clears things up, and I am open to any other options or ideas.