This repository has been archived on 2024-10-25. You can view files and clone it, but cannot push or open issues or pull requests.
Sequenzia/Rails/ActionView/Layout.php

31 lines
677 B
PHP
Raw Normal View History

2013-10-02 08:12:58 +02:00
<?php
namespace Rails\ActionView;
use Rails;
class Layout extends Template
{
protected $template_filename;
protected $filename;
public function __construct($layoutName, array $params = [], $locals = [])
{
$this->template_filename = $layoutName;
$this->filename = $this->resolve_layout_file($layoutName);
if (isset($params['contents'])) {
$this->_buffer = $params['contents'];
}
$locals && $this->setLocals($locals);
}
public function renderContent()
{
ob_start();
require $this->filename;
$this->_buffer = ob_get_clean();
}
}