think\View::engine PHP Method

engine() public method

设置当前模板解析的引擎
public engine ( array | string $options = [] )
$options array | string 引擎参数
    public function engine($options = [])
    {
        if (is_string($options)) {
            $type = $options;
            $options = [];
        } else {
            $type = !empty($options['type']) ? $options['type'] : 'Think';
        }
        $class = false !== strpos($type, '\\') ? $type : '\\think\\view\\driver\\' . ucfirst($type);
        if (isset($options['type'])) {
            unset($options['type']);
        }
        $this->engine = new $class($options);
        return $this;
    }