lib/Timber.php
public static function compile_string( $string, $data = array() ) {
		$dummy_loader = new Loader();
		$twig = $dummy_loader->get_twig();
		$template = $twig->createTemplate($string);
		return $template->render($data);
	}
public static function compile_string( $string, $data = array() ) {
		$dummy_loader = new Loader();
		$twig = $dummy_loader->get_twig();
		$template = $twig->createTemplate($string);
		return $template->render($data);
	}
public static function compile_string ( $ string , $ data = array ( ) ) { $ dummy_loader = new Loader ( ) ; $ twig = $ dummy_loader -> get_twig ( ) ; $ template = $ twig -> createTemplate ( $ string ) ; return $ template -> render ( $ data ) ; }
Compile a string.

@api
@example
```php
$data = array(
'username' => 'Jane Doe',
);

$welcome = Timber::compile_string( 'Hi {{ username }}, I’m a string with a custom Twig variable', $data );
```
@param string $string A string with Twig variables.
@param array  $data   Optional. An array of data to use in Twig template.
@return  bool|string
Compile a string .