Twig::__construct PHP Метод

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

public __construct ( $params = [] )
    public function __construct($params = [])
    {
        if (isset($params['functions'])) {
            $this->functions_asis = array_unique(array_merge($this->functions_asis, $params['functions']));
            unset($params['functions']);
        }
        if (isset($params['functions_safe'])) {
            $this->functions_safe = array_unique(array_merge($this->functions_safe, $params['functions_safe']));
            unset($params['functions_safe']);
        }
        if (isset($params['paths'])) {
            $this->paths = $params['paths'];
            unset($params['paths']);
        } else {
            $this->paths = [VIEWPATH];
        }
        // default Twig config
        $this->config = ['cache' => APPPATH . 'cache/twig', 'debug' => ENVIRONMENT !== 'production', 'autoescape' => TRUE];
        $this->config = array_merge($this->config, $params);
    }