Jump to content

Create $Obj In Getcontent Function


seyha

Recommended Posts

Dear All,

 

I have a problem relate to getContent function. I would like to instantiate one Object from other class in order to access the method in that class.

 

the problem is : I can not create Ojbect in getContent functions.

 

These are my codes :

 

This is work as normally

public function getContent($tab = 'AdminModules')

{

global $currentIndex, $cookie;

$token = Tools::getAdminToken($tab.intval(Tab::getIdFromClassName($tab)).intval($cookie->id_employee));

 

$this->_postProcess($token); //internal method

 

if(isset($_GET['view']) && $_GET['view']=='device'){

$this->createDevice($token); // internal method

}else{

$this->employeeList($token); // internal method

}

return $this->_html;

}

 

But this is not works

 

public function getContent($tab = 'AdminModules')

{

global $currentIndex, $cookie;

$token = Tools::getAdminToken($tab.intval(Tab::getIdFromClassName($tab)).intval($cookie->id_employee));

 

$obj = new functions(); (This is not works)

$obj->postProcess($token);//external method

 

if(isset($_GET['view']) && $_GET['view']=='device'){

$this->createDevice($token); // display create device screen

}else{

$this->employeeList($token); // display customers list

}

return $this->_html;

}

 

If anyone know how to fix this problem please tell me. I am appreciate with your helps.

 

Best Regards,

I am looking forward to hearing from you.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...