Skip to content

Commit e23bb1d

Browse files
committed
datagridbundle: allow passing extra data to template
1 parent 725846f commit e23bb1d

1 file changed

Lines changed: 12 additions & 2 deletions

File tree

Service/DataGridService.php

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,16 @@ class DataGridService
3131
* @var RequestStack
3232
*/
3333
private $requestStack;
34+
35+
protected $extraData = [];
36+
37+
/**
38+
* @param mixed $extraData
39+
*/
40+
public function setExtraData($extraData)
41+
{
42+
$this->extraData = $extraData;
43+
}
3444

3545
/**
3646
* DataGridService constructor.
@@ -110,10 +120,10 @@ public function render()
110120
{
111121
$this->addFiltersToQb();
112122
$this->doCallbacks();
113-
return $this->twig->render('BBITDataGridBundle:Default:grid.html.twig', [
123+
return $this->twig->render('BBITDataGridBundle:Default:grid.html.twig', array_merge([
114124
'fields' => $this->fields,
115125
'data' => $this->pagedData
116-
]
126+
], $this->extraData)
117127

118128
);
119129
}

0 commit comments

Comments
 (0)