Kohana_Twig::__construct PHP Метод

__construct() публичный Метод

Constructor
Автор: Jonathan Geiger
public __construct ( $file = NULL, array $data = NULL, $env = 'default' )
$data array
    public function __construct($file = NULL, $data = NULL, $env = 'default')
    {
        if ($file !== NULL) {
            $this->set_filename($file);
        }
        // Allow passing the environment if $data is not needed
        if (is_string($data)) {
            $env = $data;
            $data = NULL;
        }
        if ($data !== NULL) {
            // Add the values to the current data
            $this->_data = $data + $this->_data;
        }
        // Allow passing a Twig_Environment
        if ($env instanceof Twig_Environment == FALSE) {
            // Load the default extension from the config
            $this->_extension = Kohana::$config->load('twig.' . $env . '.loader.extension');
            $env = Kohana_Twig_Environment::instance($env);
        }
        $this->_environment = $env;
    }