Skip to content
This repository was archived by the owner on Feb 17, 2022. It is now read-only.

7.x 2.x helper content render

Andy Truong edited this page Jan 17, 2014 · 17 revisions

Render a string

```php
$render = at_container('helper.content_render');
$render->render('Hello Drupal!');
```

Render content with function callback

```php
$render = at_container('helper.content_render');
$render->render(array(
  'function' => 't', 
  'arguments' => array('Hello Drupal!')
));
```

Render content with a Twig template

```php
$render = at_container('helper.content_render');
$render->render(array(
  'template' => '@my_module/templates/hello.html.twig', 
  'variables' => array('name' => 'Drupal')
));
```

Clone this wiki locally