Sequenzia/lib/Rails/ActionController/Response/Inline.php

26 lines
730 B
PHP
Raw Normal View History

2013-10-02 18:14:53 +02:00
<?php
namespace Rails\ActionController\Response;
use Rails\ActionView;
# TODO
class Inline extends Base
{
private $_template;
public function _render_view()
{
# Include helpers.
ActionView\ViewHelpers::load();
$layout = !empty($this->_params['layout']) ? $this->_params['layout'] : false;
# Create a template so we can call render_inline;
$this->_template = new ActionView\Template(['inline' => $this->_params['code']], ['layout' => $layout]);
2013-10-21 10:07:58 +02:00
$this->_template->setLocals(\Rails::application()->controller()->vars());
2013-10-02 18:14:53 +02:00
$this->_template->renderContent();
}
public function _print_view()
{
return $this->_template->content();
}
}