function setup (Component $parent = null, DocumentContext $context, $props = null, array $bindings = null)
  {
    if (is_object ($props)) {
      $this->props = $props;
      $props       = [];
    }
    $this->setContext ($context);
    $this->bindings = $bindings;
    $this->onCreate ($props, $parent);
    $this->setProps ($props);
    $this->init ();
    return $this;
  }
function setup (Component $parent = null, DocumentContext $context, $props = null, array $bindings = null)
  {
    if (is_object ($props)) {
      $this->props = $props;
      $props       = [];
    }
    $this->setContext ($context);
    $this->bindings = $bindings;
    $this->onCreate ($props, $parent);
    $this->setProps ($props);
    $this->init ();
    return $this;
  }
function setup ( Component $ parent = null , DocumentContext $ context , $ props = null , array $ bindings = null ) { if ( is_object ( $ props ) ) { $ this -> props = $ props ; $ props = [ ] ; } $ this -> setContext ( $ context ) ; $ this -> bindings = $ bindings ; $ this -> onCreate ( $ props , $ parent ) ; $ this -> setProps ( $ props ) ; $ this -> init ( ) ; return $ this ; }
Initializes a component right after instantiation.

<p>**Note:** this method may not be called on some circumstances, for ex, if the component is rendered from a
middleware stack.

@param Component|null                $parent   The component's container component (if any).
@param DocumentContext               $context  A rendering context.
@param array|AbstractProperties|null $props    A map of property names to property values.
Properties specified via this argument come only from markup
attributes, not from subtags. If it's a properties object, it is
assigned as is.
@param array|null                    $bindings A map of attribute names and corresponding databinding
expressions.
@return Component Component instance.
@throws ComponentException
@throws ReflectionPropertyException
Initializes a component right after instantiation .