Welcome Guest, Not a member yet? Register   Sign In
Calling Controllers Functions with function name in a php variable
#2

[eluser]gtech[/eluser]
I tried somthing similar as a test for you and it worked.. create a controller called test.php copy the code and give it a go!
Code:
<?php
class Test extends Controller {

  function Test()
  {
    parent::Controller();
  }
  function start($func='myname')
  {
    echo "hello";
    $this->$func();
  }
  function myname()
  {
    echo " gtech";
  }
}
?>

result
Code:
hello gtech

Or are you trying to do something different? you may just have a typo (typing error) somewhere.


Messages In This Thread
Calling Controllers Functions with function name in a php variable - by El Forum - 11-29-2007, 08:13 AM



Theme © iAndrew 2016 - Forum software by © MyBB