/**
  * @return string
  * @throws NotSupportedException if the treeType is invalid or null
  */
 public function getContent()
 {
     $this->form->setInputPrefixData($this->inputPrefixData);
     $content = $this->getAttributeContent();
     $this->form->clearInputPrefixData();
     return $content;
 }
コード例 #2
0
 public function actionAddEmailMessage($moduleClassName, $type, $rowNumber)
 {
     $form = new WizardActiveForm();
     $form->id = WorkflowWizardView::getFormId();
     $form->enableAjaxValidation = true;
     //ensures error validation populates correctly
     $rowCounterInputId = ComponentForWorkflowWizardView::resolveRowCounterInputId(ComponentForWorkflowForm::TYPE_EMAIL_MESSAGES);
     $wizardFormClassName = WorkflowToWizardFormAdapter::getFormClassNameByType($type);
     $model = ComponentForWorkflowFormFactory::makeByComponentType($moduleClassName, $moduleClassName::getPrimaryModelName(), $type, ComponentForWorkflowForm::TYPE_EMAIL_MESSAGES);
     $inputPrefixData = array($wizardFormClassName, ComponentForWorkflowForm::TYPE_EMAIL_MESSAGES, (int) $rowNumber);
     $form->setInputPrefixData($inputPrefixData);
     $view = new EmailMessageRowForWorkflowComponentView($model, (int) $rowNumber, $inputPrefixData, $form, WorkflowToWizardFormAdapter::getFormClassNameByType($type), $rowCounterInputId);
     $content = $view->render();
     $form->renderAddAttributeErrorSettingsScript($view::getFormId());
     Yii::app()->getClientScript()->setToAjaxMode();
     Yii::app()->getClientScript()->render($content);
     echo $content;
 }