Example #1
0
 /**
  * AbstractForm constructor.
  *
  * @param string $name
  * @param string $title
  * @param string $action
  * @param string $method
  * @param string $encType
  *
  * @throws ArgumentException
  * @throws ArgumentTypeException
  */
 public function __construct($name, $action = '', $method = 'post', $title = '', $encType = self::ENC_TYPE_URLENCODED)
 {
     parent::__construct($name, $title);
     if (!is_null($action)) {
         $this->action($action);
     }
     if (!is_null($method)) {
         $this->method($method);
     }
     if (!is_null($encType)) {
         $this->encType($encType);
     }
     $this->handlers = new NamedObjectList();
     $this->handlers->setElementClasses(['NewInventor\\Form\\Interfaces\\HandlerInterface']);
     $this->children()->setElementClasses([Block::getClass(), AbstractField::getClass()]);
     $defaultData = (include __DIR__ . '/config/default.php');
     $this->addDefaultConfig('renderer', $defaultData['renderer']);
     $this->addDefaultConfig('validator', $defaultData['validator']);
 }