are.ehibou.com

September 12, 2008

anonymous, dynamic, variable classes and methods

Filed under: Side Notes, php — Tags: — admin @ 2:53 pm

To call a method by dynamic name you can do this:

$methodName="MyMethod";
$result=$methodName();

To create a class by dynamic name you can do this:

$className="MyClass";
$classVar=new $className;

To call any method by dynamic name in previously initialized class you can do this:

$methodName="MyMethod";
$result=$classVar->$methodName();
  • Share/Bookmark

September 8, 2008

Generic Configuration Section Handler

Filed under: C#.NET — admin @ 12:55 pm

Check this link. It is a good way to deal with configuration sections in .NET environment.

  • Share/Bookmark

Powered by WordPress