Adds new override for components, onInit()
This commit is contained in:
parent
4951393986
commit
e2fa45e264
|
|
@ -87,6 +87,11 @@ abstract class ComponentBase extends Extendable
|
|||
return base_path() . Config::get('cms.pluginsDir') . $this->dirName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Executed when this component is first initialized, before AJAX requests.
|
||||
*/
|
||||
public function onInit() {}
|
||||
|
||||
/**
|
||||
* Executed when this component is bound to a page or layout.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -273,6 +273,7 @@ class Controller extends BaseController
|
|||
$this->vars[$alias] = $this->page->components[$alias] = $componentObj;
|
||||
}
|
||||
|
||||
$componentObj->onInit();
|
||||
return $componentObj;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue