Clean (field) name

@see FormHelper::label()
@param string $name Field name
@return string
350604
protected function cleanName(string $name) : string
    {
        if ('._ids' === substr($name, -5)) {
            $name = substr($name, 0, -5);
        }

        if (false !== strpos($name, '.')) {
            $fieldElements = explode('.', $name);
            $name = false !== end($fieldElements) ? end($fieldElements) : $name;
        }

        if (substr($name, -3) === '_id') {
            $name = substr($name, 0, -3);
        }
        $name = Inflector::humanize(Inflector::underscore($name));

        return $name;
    }
205503
public function getCleanParam($name){
        if(isset($this->getParams[$name])){            
            return Security::clean_vars($this->getParams[$name]);
        }else{
            return NULL;
        }
    }
750986
private function underscore($name)
    {
        $result = preg_replace('/([A-Z]|[0-9]+)/', "_$1", $name);
        $result = trim($result, '_');
        $result = strtolower($result);
        
        return $result;
    }
1323980
private function getFullQualifiedAssetName($name)
    {
        $name = $this->getUnquotedAssetName($name);

        if (strpos($name, '.') === false) {
            $name = $this->getName() . '.' . $name;
        }

        return strtolower($name);
    }
855078
protected function normalizeName($name)
	{
		$delimiter = ViewFinderInterface::HINT_PATH_DELIMITER;

		if (strpos($name, $delimiter) === false)
		{
			return str_replace('/', '.', $name);
		}

		list($namespace, $name) = explode($delimiter, $name);

		return $namespace . $delimiter . str_replace('/', '.', $name);
	}
554377
public function label( string $name ) {
		return $this->$name ? get_field_object( $name, $this->term )['label'] : FALSE;
	}
94519
public static function adminFormFieldLabel($field) {

        // Does the field have an alternate name?
        $name = $field['name'];

        if (!empty($field['alternate_form_name'])) {
            $name = $field['alternate_form_name'];
        } 

        if ($name == "id") return "ID";

        $html = str_replace("_", " ", $name);
        $html = ucwords($html);
        return $html;
    }
35630
private function removeOptionalFromName($name)
    {
        $this->regex = new Regex(Url::SQUARE_BRACKETS);
        if($matches = $this->regex->getMatches($name))
        {
            /**
             *  th' route has an optional field [/:var] at th' end garr
             *  we'll add it after we've done the rest
             */
            $this->optional = str_replace('/','',$matches[1]);
            $name = str_replace('[/'.$this->optional.']','', $name);
        }
        return $name;
    }
1263745
public static function getHiddenField(string $name = null): string
    {
        $name = $name ?: self::$currentName;

        return sprintf('<input type="text" name="%s" style="display: none">', $name);
    }
151737
public static function normalize($name)
	{
		if (!static::isValid($name))
		{
			throw new InvalidArgumentException("Invalid tag name '" . $name . "'");
		}

		// Non-namespaced tags are uppercased
		if (strpos($name, ':') === false)
		{
			$name = strtoupper($name);
		}

		return $name;
	}
895789
protected function getSubformElementName($name)
    {
        $formName = isset($this->attributes['name']) ? $this->attributes['name'] : $this->getName();

        return $formName . '[' . $name . ']';
    }
855492
private function getRichFieldName(string $name): string
    {
        $this->initRichModelUtils();
        $exceptedName = \lcfirst($name);

        $field = $this->richAccessMapExists ? null : $exceptedName;

        if ($this->richAccessMapExists) {
            if (\array_key_exists($exceptedName, $this->richAccessMapArray)) {
                $field = $this->richAccessMapArray[$exceptedName];
            } elseif (!\array_key_exists(RichModelInterface::RICH_STRICT, $this->richAccessMapArray)) {
                $field = $exceptedName;
            }
        }

        if (!$field || !$this->richClassReflection->hasProperty($field)) {
            throw new RichModelFieldException(\sprintf('Field "%s" (remapped: %s) not found!', $name, $field));
        }

        return $field;
    }
325428
public function getFormName($name)
    {
        return isset($this->forms[$name]['name']) ? $this->forms[$name]['name'] : null;
    }
547562
public function cleanName($name)
    {
        $response = $this->query($this->prepareUri('clean/name'), [$name]);
        $result = $this->populate(new Name(), $response);
        if (!$result instanceof Name) {
            throw new RuntimeException('Unexpected populate result: ' . get_class($result). '. Expected: ' . Name::class);
        }

        return $result;
    }
436586
public function label($name, $attributes = [])
    {
        $attributeString = '';

        if (!isset($attributes['for'])) {
            $attributeString = 'for="'.$name.'"';
        }

        foreach ($attributes as $key => $value) {
            $attributeString .= $key.'="'.$value.'" ';
        }

        return '<label '.$attributeString.'>'.$name.'</label>';
    }
759288
public function field($name) {
        $this->_fields['' . $name . ''] = new Field($name, $this->_name);

        return $this->_fields['' . $name . ''];
    }
41356
public function getFormControlByName(string $name): Control
  {
    $control = $this->findFormControlByName($name);
    if ($control===null)
    {
      throw new LogicException("Form control with name '%s' does not exists.", $name);
    }

    return $control;
  }