Adds new override for components, onInit()

This commit is contained in:
Sam Georges 2014-05-24 21:59:30 +10:00
parent 4951393986
commit e2fa45e264
2 changed files with 6 additions and 0 deletions

View File

@ -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.
*/

View File

@ -273,6 +273,7 @@ class Controller extends BaseController
$this->vars[$alias] = $this->page->components[$alias] = $componentObj;
}
$componentObj->onInit();
return $componentObj;
}