REVISED
I have a simple question, but being new to OOP I am not sure if this is possible.
Currently I have a class with one function that accepts an argument. What the actual function does is irrelevant.
<?php
class Method {
public function show($parameter){
echo $parameter;
}
}
?>
I create the object like this...
$this->Method = new Method();
And use it like this...
$this->Method->show($parameter);
So the question is, can my function be set up in a way to simplify the use to this...
$this->Method($parameter);
I tried by changing the function to a __construct and using the above line of code but it fails since the new Method() was created without a $parameter specified.
I was hoping to be able to pass the $parameter after the new Method(); was called.
$this->Method($parameter);do in this example?__invokemethod, but I don't know if that's what you intended.