1: <?php
2:
3: /*
4: * To change this license header, choose License Headers in Project Properties.
5: * To change this template file, choose Tools | Templates
6: * and open the template in the editor.
7: */
8:
9: namespace academicpuma\citeproc;
10:
11: /**
12: * Description of csl_macros
13: *
14: * @author sebastian
15: */
16:
17: class Macros extends Collection {
18:
19: function __construct($macro_nodes, $citeproc) {
20: foreach ($macro_nodes as $macro) {
21: $macro = Factory::create($macro, $citeproc);
22: $this->elements[$macro->name()] = $macro;
23: }
24: }
25:
26: function render_macro($name, $data, $mode) {
27: return $this->elements[$name]->render($data, $mode);
28: }
29:
30: }
31: