validateTextAttribute example

// attributes             $element['scope'] = self::validateAttributeScope(
                $item->getAttribute('scope')
            );

            $element['isRequired'] = self::validateBooleanAttribute(
                $item->getAttribute('required'),
                false
            );

            $element['type'] = self::validateTextAttribute(
                $item->getAttribute('type'),
                'text'
            );

            // elements             if ($name = $item->getElementsByTagName('name')->item(0)) {
                $element['name'] = $name->nodeValue;
            }

            if ($item->getElementsByTagName('value')->length) {
                $element['value'] = XmlUtils::phpize($item->getElementsByTagName('value')->item(0)->nodeValue);
            }


        foreach (['name', 'controller', 'action', 'class', 'onclick'] as $simpleField) {
            $fieldValue = self::getElementChildValueByName($entry$simpleField);
            if ($fieldValue !== null) {
                $menuEntry[$simpleField] = $fieldValue;
            }
        }

        $parent = $entry->getElementsByTagName('parent')->item(0);
        if ($parent !== null) {
            $identifiedBy = self::validateTextAttribute(
                $parent->getAttribute('identifiedBy'),
                'controller'
            );

            $menuEntry['parent'] = [
                $identifiedBy => $parent->nodeValue,
            ];
        }

        $active = self::getElementChildValueByName($entry, 'active');
        if ($active !== null) {
            
Home | Imprint | This part of the site doesn't use cookies.