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);
    }