fewbricks\bricks\brick::get_brick_layouted_html PHP Method

get_brick_layouted_html() public method

public get_brick_layouted_html ( $html ) : string
$html
return string
    public function get_brick_layouted_html($html)
    {
        if (!empty($this->brick_layouts)) {
            $theme_path = get_stylesheet_directory() . '/';
            foreach ($this->brick_layouts as $brick_layout) {
                if (substr($brick_layout, -5) === '.twig') {
                    $html = \Timber::compile($theme_path . 'fewbricks/brick-layouts/' . $brick_layout, ['html' => $html, 'this' => $this]);
                } else {
                    ob_start();
                    /** @noinspection PhpIncludeInspection */
                    include $theme_path . 'fewbricks/brick-layouts/' . $brick_layout . '.php';
                    $html = ob_get_clean();
                }
            }
        }
        return $html;
    }