public function __construct($params = null) { parent::__construct($params); $className = get_class($this); if (!preg_match('/^\\w+_Form_(.+)$/', $className, $matches)) { throw new CM_Exception('Cannot detect namespace from form\'s classname', null, ['className' => $className]); } $name = lcfirst($matches[1]); $name = preg_replace('/([A-Z])/', '_\\1', $name); $name = strtolower($name); $this->_name = $name; $this->_initialize(); }
public function __construct($params = null) { parent::__construct($params); $this->_name = $this->_params->getString('name', uniqid()); $this->_initialize(); }