public function addElement($element, $title = null, $name = null, $attrs = null) {
		if (! $element instanceof Element &&
			! $element instanceof Divider) {
			
			if ($element === self::DIVIDER) {
				$element = new Divider(null, $attrs);
			} else {
				if ($title === null) {
					$title = $element;
				}
				
				$element = new Element($element, $title, $attrs);
			}
		}
		
		if ($name === null && $title !== null) {
			$name = $title;
		}
		
		return parent::addElement($element, $name);
	}
public function addElement($element, $title = null, $name = null, $attrs = null) {
		if (! $element instanceof Element &&
			! $element instanceof Divider) {
			
			if ($element === self::DIVIDER) {
				$element = new Divider(null, $attrs);
			} else {
				if ($title === null) {
					$title = $element;
				}
				
				$element = new Element($element, $title, $attrs);
			}
		}
		
		if ($name === null && $title !== null) {
			$name = $title;
		}
		
		return parent::addElement($element, $name);
	}
public function addElement ( $ element , $ title = null , $ name = null , $ attrs = null ) { if ( ! $ element instanceof Element && ! $ element instanceof Divider ) { if ( $ element === self :: DIVIDER ) { $ element = new Divider ( null , $ attrs ) ; } else { if ( $ title === null ) { $ title = $ element ; } $ element = new Element ( $ element , $ title , $ attrs ) ; } } if ( $ name === null && $ title !== null ) { $ name = $ title ; } return parent :: addElement ( $ element , $ name ) ; }
Add an element to the navigation

@param  mixed  $element
@param  string $title
@param  string $name
@return Navigation
Add an element to the navigation