display() public method

Renders Twig Template and Set Output
public display ( string $view, array $params = [] )
$view string Template filename without `.twig`
$params array Array of parameters to pass to the template
 public function testDisplay()
 {
     $obj = new Twig(['paths' => __DIR__ . '/../templates/']);
     $data = ['name' => 'CodeIgniter'];
     $obj->display('welcome', $data);
     $CI =& get_instance();
     $output = $CI->output->get_output();
     $this->assertEquals('Hello CodeIgniter!' . "\n", $output);
 }