/** * Initializes the widget Button options. * This method sets the default values for various options. */ public function initOpenButton() { $widget = Button::begin($this->openButton); $msg = "'{$this->body}', '{$this->title}'"; $jsOpen = 'toastr.' . $this->type . '(' . $msg . ')'; if (!isset($widget->clientEvents['click'])) { $widget->clientEvents['click'] = "function(){{$jsOpen};}"; } $widget->run(); }
/** * Renders the toggle button. * @return string the rendering result */ protected function renderToggleButton() { if (!empty($this->toggleButton)) { return Button::widget($this->toggleButton); } else { return null; } }