public function loadElement($type, $new = false)
	{
		if ($type == 'list')
		{
			$type = 'select';
		}

		$signature = md5($type);

		if ((isset($this->_elements[$signature]) && !($this->_elements[$signature] instanceof __PHP_Incomplete_Class)) && $new === false)
		{
			return $this->_elements[$signature];
		}

		$elementClass = __NAMESPACE__ . '\\Parameter\\Element\\' . ucfirst($type);

		if (!class_exists($elementClass))
		{
			if (isset($this->_elementPath))
			{
				$dirs = $this->_elementPath;
			}
			else
			{
				$dirs = array();
			}

			preg_match('/^[A-Za-z0-9_-]+[A-Za-z0-9_\.-]*([\\\\\/][A-Za-z0-9_-]+[A-Za-z0-9_\.-]*)*$/', str_replace('_', DS, $type) . '.php', $matches);
			$file = @ (string) $matches[0];

			if ($elementFile = \App::get('filesystem')->find($dirs, $file))
			{
				include_once $elementFile;
			}
			else
			{
				$false = false;
				return $false;
			}
		}

		if (!class_exists($elementClass))
		{
			$false = false;
			return $false;
		}

		$this->_elements[$signature] = new $elementClass($this);

		return $this->_elements[$signature];
	}
public function loadElement($type, $new = false)
	{
		if ($type == 'list')
		{
			$type = 'select';
		}

		$signature = md5($type);

		if ((isset($this->_elements[$signature]) && !($this->_elements[$signature] instanceof __PHP_Incomplete_Class)) && $new === false)
		{
			return $this->_elements[$signature];
		}

		$elementClass = __NAMESPACE__ . '\\Parameter\\Element\\' . ucfirst($type);

		if (!class_exists($elementClass))
		{
			if (isset($this->_elementPath))
			{
				$dirs = $this->_elementPath;
			}
			else
			{
				$dirs = array();
			}

			preg_match('/^[A-Za-z0-9_-]+[A-Za-z0-9_\.-]*([\\\\\/][A-Za-z0-9_-]+[A-Za-z0-9_\.-]*)*$/', str_replace('_', DS, $type) . '.php', $matches);
			$file = @ (string) $matches[0];

			if ($elementFile = \App::get('filesystem')->find($dirs, $file))
			{
				include_once $elementFile;
			}
			else
			{
				$false = false;
				return $false;
			}
		}

		if (!class_exists($elementClass))
		{
			$false = false;
			return $false;
		}

		$this->_elements[$signature] = new $elementClass($this);

		return $this->_elements[$signature];
	}
public function loadElement ( $ type , $ new = false ) { if ( $ type == 'list' ) { $ type = 'select' ; } $ signature = md5 ( $ type ) ; if ( ( isset ( $ this -> _elements [ $ signature ] ) && ! ( $ this -> _elements [ $ signature ] instanceof __PHP_Incomplete_Class ) ) && $ new === false ) { return $ this -> _elements [ $ signature ] ; } $ elementClass = __NAMESPACE__ . '\\Parameter\\Element\\' . ucfirst ( $ type ) ; if ( ! class_exists ( $ elementClass ) ) { if ( isset ( $ this -> _elementPath ) ) { $ dirs = $ this -> _elementPath ; } else { $ dirs = array ( ) ; } preg_match ( '/^[A-Za-z0-9_-]+[A-Za-z0-9_\.-]*([\\\\\/][A-Za-z0-9_-]+[A-Za-z0-9_\.-]*)*$/' , str_replace ( '_' , DS , $ type ) . '.php' , $ matches ) ; $ file = @ ( string ) $ matches [ 0 ] ; if ( $ elementFile = \ App :: get ( 'filesystem' ) -> find ( $ dirs , $ file ) ) { include_once $ elementFile ; } else { $ false = false ; return $ false ; } } if ( ! class_exists ( $ elementClass ) ) { $ false = false ; return $ false ; } $ this -> _elements [ $ signature ] = new $ elementClass ( $ this ) ; return $ this -> _elements [ $ signature ] ; }
Loads an element type.

@param   string   $type  The element type.
@param   boolean  $new   False (default) to reuse parameter elements; true to load the parameter element type again.
@return  object
Loads an element type .