AbanteCart Development > Development Help Needed

Is it possible to hook functions in controller?

<< < (2/2)

abolabo:
every method of core-controller contain 2 hook calls:
//init controller data
$this->extensions->hk_InitData($this, __FUNCTION__);

and
//update controller data
$this->extensions->hk_UpdateData($this, __FUNCTION__);

You just should to add methods
public function onControllerPagesAccountAddress_InitData(){
    //write your code here
}

and

public function onControllerPagesAccountAddress_UpdateData(){
    //write your code here
}

yonghan:
I've tried using Update_Data() to hook before,but when i run the code,the rest of the core function didn't work.

abolabo:

--- Quote from: yonghan on July 26, 2014, 10:09:10 AM ---I've tried using Update_Data() to hook before,but when i run the code,the rest of the core function didn't work.

--- End quote ---

i guess you call hook on all methods on core-controller.
use condition if($this->baseObject_method='name of method')  to define place when your hook must work

yonghan:
I will try it again,thanks a lot.

Navigation

[0] Message Index

[*] Previous page

Go to full version
Powered by SMFPacks Social Login Mod