public function dispatch($component = null) { if ($this->get('dispatched') == true) { return; } if (empty($component)) { $component = MRequest::getCmd('option'); } mimport('framework.application.component.helper'); $output = MComponentHelper::renderComponent($component); $this->set('output', $output); // Trigger the onAfterDispatch event. MPluginHelper::importPlugin('system'); $this->triggerEvent('onAfterDispatch'); $this->set('dispatched', true); }