예제 #1
0
 /**
  * Get form instance
  *
  * @return \Application\Form\ApplicationCustomFormBuilder
  */
 public function getForm()
 {
     // get form builder
     if (!$this->form) {
         if ($this->model) {
             // fill the form with default values
             $this->formElements['modules']['values'] = $this->model->getActiveModulesList();
         }
         $this->form = new ApplicationCustomFormBuilder($this->formName, $this->formElements, $this->translator, $this->ignoredElements, $this->notValidatedElements, $this->method);
     }
     return $this->form;
 }
예제 #2
0
파일: Page.php 프로젝트: esase/dream-cms
 /**
  * Validate slug
  *
  * @param $value
  * @param array $context
  * @return boolean
  */
 public function validateSlug($value, array $context = [])
 {
     return $this->model->isSlugFree($value, !empty($this->pageInfo['id']) ? $this->pageInfo['id'] : 0);
 }