Gregwar\Formidable\Fields\Field::setName PHP Method

setName() public method

public setName ( $name )
    public function setName($name)
    {
        if (preg_match('#^(.+)\\[(.*)\\]$#mUsi', $name, $match) == 1) {
            $this->name = $match[1];
            $this->index = array();
            if ($match[2]) {
                $parts = explode('][', $match[2]);
                foreach ($parts as $part) {
                    $this->index[] = $part;
                }
            }
        } else {
            $this->name = $name;
        }
    }