<commit_before><?php

namespace pff;

/**
 * Layout system with PHP templates
 *
 * A layout is a specific type of View: it represents a common layout with most
 * of its elements fixed and a few placeholders to render custom views.
 *
 * @author paolo.fagni<at>gmail.<EMAIL>
 */
class LayoutPHP extends \pff\ViewPHP {

    /**
     * @var \pff\AView[]
     */
    private $_contentView;

    /**
     * Adds an Aview to the layout queue
     *
     * @param \pff\AView $view
     */
    public function addContent(\pff\AView $view) {
        $this->_contentView[] = $view;
    }

    /**
     * Show the content in the layout
     *
     * Add "<?php $this->content()?>" in your layout template where you want to
     * display the AView object
     *
     * @param int $index
     */
    public function content($index = 0) {
        $this->_contentView[$index]->render();
    }
}<commit_msg>Fix for rendering empty views<commit_after><?php

namespace pff;

/**
 * Layout system with PHP templates
 *
 * A layout is a specific type of View: it represents a common layout with most
 * of its elements fixed and a few placeholders to render custom views.
 *
 * @author paolo.fagni<at>gmail.com
 */
class LayoutPHP extends \pff\ViewPHP {

    /**
     * @var \pff\AView[]
     */
    private $_contentView;

    /**
     * Adds an Aview to the layout queue
     *
     * @param \pff\AView $view
     */
    public function addContent(\pff\AView $view) {
        $this->_contentView[] = $view;
    }

    /**
     * Show the content in the layout
     *
     * Add "<?php $this->content()?>" in your layout template where you want to
     * display the AView object
     *
     * @param int $index
     */
    public function content($index = 0) {
        if(isset($this->_contentView[$index])){
        $this->_contentView[$index]->render();
        }
    }
}
{'fraction_non_alphanumeric': 0.12486544671689989, 'fraction_numerical': 0.001076426264800861, 'mean_word_length': 2.307829181494662, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7423727', 'n_tokens_mistral': 572, 'n_tokens_neox': 564, 'n_words': 185}