protected function renderLayout(string $layoutPath): string
    {
        // Render the layout
        $renderedLayout = $this->renderTemplate($layoutPath);

        // Check if the layout has changed
        if ($this->hasLayoutChanged) {
            // Reset the flag
            $this->hasLayoutChanged = false;
            // Render the new layout
            $renderedLayout = $this->renderLayout($this->layoutPath);
        }

        return $renderedLayout;
    }
protected function renderLayout(string $layoutPath): string
    {
        // Render the layout
        $renderedLayout = $this->renderTemplate($layoutPath);

        // Check if the layout has changed
        if ($this->hasLayoutChanged) {
            // Reset the flag
            $this->hasLayoutChanged = false;
            // Render the new layout
            $renderedLayout = $this->renderLayout($this->layoutPath);
        }

        return $renderedLayout;
    }
protected function renderLayout ( string $ layoutPath ) : string { // Render the layout $ renderedLayout = $ this -> renderTemplate ( $ layoutPath ) ; // Check if the layout has changed if ( $ this -> hasLayoutChanged ) { // Reset the flag $ this -> hasLayoutChanged = false ; // Render the new layout $ renderedLayout = $ this -> renderLayout ( $ this -> layoutPath ) ; } return $ renderedLayout ; }
Render a layout path.

@param string $layoutPath The layout path

@return string
Render a layout path .