Exemplo n.º 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;
 }
Exemplo n.º 2
0
 /**
  * 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);
 }