/** * @param $opts = array of options: * 'makeArray' => default false - do you want the formNames to be in an array format * bool true will use the internal counter and assume each new instance is a new object * int will use this as the array counter * * 'ignoreDefaultFormName' => default false - by default, FrontFormBuilder will create fields using ActiveRecord::$formName like so <input name='member[firstName]' ../> * if you don't want that format, set this to true */ public function __construct($obj = null, $opts = NULL) { if (is_string($obj)) { $this->formNameBase = $obj; parent::__construct(null); } else { parent::__construct($obj); } $this->isArray = isset($opts['makeArray']) && $opts['makeArray']; $this->arrayI = $this->isArray && is_int($opts['makeArray']) ? $opts['makeArray'] : ++self::$arrayI; if ($opts['ignoreDefaultFormName']) { $this->ignoreDefaultFormName = true; } }
public function __construct() { parent::__construct(); $this->setBuilder(); $this->setRequestToken(); }