Thread: eval() issue
View Single Post
Old 09-05-2011, 12:55 PM   #4 (permalink)
exangelus
The Visitor
 
Join Date: Sep 2011
Location: Eindhoven, Netherlands
Posts: 4
Thanks: 1
exangelus is on a distinguished road
Default

Thanks for the welcome :)

Thought I'd fixed it but nope.. it just seems the whole arg_order var as the first argument of the function.. quickfixed it this way but it's really ugly and there has to be a way to automate this:

PHP Code:
if(count($args) == 0) {
                    
$this->$method();
                } elseif(
count($args) == 1) {
                    
$this->$method($args[0]);
                } elseif(
count($args) == 2) {
                    
$this->$method($args[0], $args[1]);
                } elseif(
count($args) == 3) {
                    
$this->$method($args[0], $args[1], $args[2]);
                } 
Ofcourse I could simply send the array to the method but I also call the method in other ways where I strongly dislike the use of an array and I also dislike the option to alternatively accept both the normal way and the array way IF there are better options..
exangelus is offline  
Reply With Quote