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/lib/Rails/ActionView/Layout.php
2013-10-02 11:14:53 -05:00

31 lines
677 B
PHP
Executable File

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