php - Dynamically load class by name in Zend 2 -


i trying instance of class name. have controller , in controller instance of class classname. know class in namespace mymodule\entity.

what best way dynamically create instance of class zend 2 ?

namespace mymodule\controller;  class mycontroller extends abstractactioncontroller {  public function indexaction() {     $classname = "myclass"; // file myclass.php     $class = ??? // create instance $classname     $class->process(); } 

in zf1 do

$class = new mymodule_entity_classname(); 

i don't know if changed in zf2.


Comments

Popular posts from this blog

sql - invalid in the select list because it is not contained in either an aggregate function -

Angularjs unit testing - ng-disabled not working when adding text to textarea -

How to start daemon on android by adb -