This repository was archived by the owner on Feb 17, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
7.x 2.x helper content render
Andy Truong edited this page Jan 17, 2014
·
17 revisions
```php
$render = at_container('helper.content_render');
$render->render('Hello Drupal!');
```
```php
$render = at_container('helper.content_render');
$render->render(array(
'function' => 't',
'arguments' => array('Hello Drupal!')
));
```
```php
$render = at_container('helper.content_render');
$render->render(array(
'template' => '@my_module/templates/hello.html.twig',
'variables' => array('name' => 'Drupal')
));
```
```php
$render = at_container('helper.content_render');
$render->render(array(
'controller' => ['Foo', 'bar'],
'arguments' => array('name' => 'Drupal')
));
```
```php
$render = at_container('helper.content_render');
$render->render(array(
'template_string' => 'Hello {{ name|t }}',
'variables' => array('name' => 'Drupal')
));
```
If the output is expensive, we can cache it:
```php
$render = at_container('helper.content_render');
$output = $render->render(array(
));
```
___ ___________ _ _
/ _ \_ _| ___ \ | | | |
/ /_\ \| | | |_/ / __ _ ___ ___ _ __ ___ ___ __| |_ _| | ___
| _ || | | ___ \/ _` / __|/ _ \ | '_ ` _ \ / _ \ / _` | | | | |/ _ \
| | | || | | |_/ / (_| \__ \ __/_| | | | | | (_) | (_| | |_| | | __/
\_| |_/\_/ \____/ \__,_|___/\___(_)_| |_| |_|\___/ \__,_|\__,_|_|\___|
- Caching
- Twig template
- twig Service
- twig_string Service
- Recipes
- Extends
- Easy Block
- Easy Routing
- Easy Breadcrumb
- Entity Template
- Drush Commands:
- Functions:
- Misc
- Status
- Tools for Development enviroment
- /devel/php improved
- /at/sql
- /at/twig
- Kint integration