src/Forms/FieldList.php
public function dataFieldByName($name)
    {
        if ($dataFields = $this->dataFields()) {
            foreach ($dataFields as $child) {
                if (trim($name) == trim($child->getName()) || $name == $child->id) {
                    return $child;
                }
            }
        }
        return null;
    }
public function dataFieldByName($name)
    {
        if ($dataFields = $this->dataFields()) {
            foreach ($dataFields as $child) {
                if (trim($name) == trim($child->getName()) || $name == $child->id) {
                    return $child;
                }
            }
        }
        return null;
    }
public function dataFieldByName ( $ name ) { if ( $ dataFields = $ this -> dataFields ( ) ) { foreach ( $ dataFields as $ child ) { if ( trim ( $ name ) == trim ( $ child -> getName ( ) ) || $ name == $ child -> id ) { return $ child ; } } } return null ; }
Returns a named field in a sequential set.
Use this if you're using nested FormFields.

@param string $name The name of the field to return
@return FormField instance
Returns a named field in a sequential set . Use this if you re using nested FormFields .