src/Traits/Component.php
protected function load( $component, $args = [] ) {
		$args = (array) $args;

		if ( ! property_exists( $this, $component ) ) {
			return false;
		}

		$class = $this->$component;

		if ( ! is_string( $class ) ) {
			return false;
		}
		if ( ! class_exists( $class ) ) {
			throw new \Exception( sprintf( 'Can not find class "%s" for Component "%s" in parent Component "%s"', $class, $component, __CLASS__ ) );
		}
		$this->$component = $this->container->create( $class, $args );

		return true;
	}
protected function load( $component, $args = [] ) {
		$args = (array) $args;

		if ( ! property_exists( $this, $component ) ) {
			return false;
		}

		$class = $this->$component;

		if ( ! is_string( $class ) ) {
			return false;
		}
		if ( ! class_exists( $class ) ) {
			throw new \Exception( sprintf( 'Can not find class "%s" for Component "%s" in parent Component "%s"', $class, $component, __CLASS__ ) );
		}
		$this->$component = $this->container->create( $class, $args );

		return true;
	}
protected function load ( $ component , $ args = [ ] ) { $ args = ( array ) $ args ; if ( ! property_exists ( $ this , $ component ) ) { return false ; } $ class = $ this -> $ component ; if ( ! is_string ( $ class ) ) { return false ; } if ( ! class_exists ( $ class ) ) { throw new \ Exception ( sprintf ( 'Can not find class "%s" for Component "%s" in parent Component "%s"' , $ class , $ component , __CLASS__ ) ) ; } $ this -> $ component = $ this -> container -> create ( $ class , $ args ) ; return true ; }
Load any property on the current component based on its string value as the class via the container

@param $component

@return bool
@throws \Exception
Load any property on the current component based on its string value as the class via the container