FOF30\Form\Header\HeaderBase::getName PHP Метод

getName() защищенный Метод

Method to get the name used for the field input tag.
С версии: 2.0
protected getName ( string $fieldName ) : string
$fieldName string The field element name.
Результат string The name to be used for the field input tag.
    protected function getName($fieldName)
    {
        $name = '';
        // If the field is in a group add the group control to the field name.
        if ($this->group) {
            // If we already have a name segment add the group control as another level.
            $groups = explode('.', $this->group);
            if ($name) {
                foreach ($groups as $group) {
                    $name .= '[' . $group . ']';
                }
            } else {
                $name .= array_shift($groups);
                foreach ($groups as $group) {
                    $name .= '[' . $group . ']';
                }
            }
        }
        // If we already have a name segment add the field name as another level.
        if ($name) {
            $name .= '[' . $fieldName . ']';
        } else {
            $name .= $fieldName;
        }
        return $name;
    }