form = $this->get('Form'); $this->item = $this->get('Item'); $this->questions = $this->get('Questions'); $this->categories = $this->get('Categories'); if (count($errors = $this->get('Errors'))) { throw new \RuntimeException(implode("\n", $errors)); } $this->addToolbar(); return parent::display($tpl); } protected function addToolbar() { ToolbarHelper::title($this->item->id ? Text::_('COM_TESTQUESTIONS_EDIT_SET') : Text::_('COM_TESTQUESTIONS_NEW_SET')); ToolbarHelper::apply('set.apply', 'JTOOLBAR_APPLY'); ToolbarHelper::save('set.save', 'JTOOLBAR_SAVE'); ToolbarHelper::cancel('set.cancel', 'JTOOLBAR_CANCEL'); } }