public function add(View $view)
    {
        // Append to the stack.
        $this->stack->append($view);

        if ($view->getType() === View::PART_BODY_PLACEHOLDER) {
            $this->bodyKey = (count($this->stack) - 1);
        }

        return count($this->stack);
    }
public function add(View $view)
    {
        // Append to the stack.
        $this->stack->append($view);

        if ($view->getType() === View::PART_BODY_PLACEHOLDER) {
            $this->bodyKey = (count($this->stack) - 1);
        }

        return count($this->stack);
    }
public function add ( View $ view ) { // Append to the stack. $ this -> stack -> append ( $ view ) ; if ( $ view -> getType ( ) === View :: PART_BODY_PLACEHOLDER ) { $ this -> bodyKey = ( count ( $ this -> stack ) - 1 ) ; } return count ( $ this -> stack ) ; }
Add a view instance to the stack.

@param View $view The view to add to the stack.
@return int number of views in the stack.
Add a view instance to the stack .