/usr/share/php/kohana2/modules/smarty/libraries/MY_Controller.php is in libkohana2-modules-php 2.3.4-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 | <?php defined('SYSPATH') OR die('No direct access allowed.');
class Controller extends Controller_Core {
function __construct()
{
parent::__construct();
if (Kohana::config('smarty.integration') == TRUE)
{
$this->MY_Smarty = new MY_Smarty;
}
}
public function _kohana_load_view($template, $vars)
{
if ($template == '')
return;
if (substr(strrchr($template, '.'), 1) === Kohana::config('smarty.templates_ext'))
{
// Assign variables to the template
if (is_array($vars) AND count($vars) > 0)
{
foreach ($vars AS $key => $val)
{
$this->MY_Smarty->assign($key, $val);
}
}
// Send Kohana::instance to all templates
$this->MY_Smarty->assign('this', $this);
// Fetch the output
$output = $this->MY_Smarty->fetch($template);
}
else
{
$output = parent::_kohana_load_view($template, $vars);
}
return $output;
}
}
|