We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0e2693d commit 543b59dCopy full SHA for 543b59d
1 file changed
src/Bridge.php
@@ -117,6 +117,28 @@ public function mergeShared(array $context)
117
return $context;
118
}
119
120
+ /**
121
+ * Merges a context with the defined globals.
122
+ *
123
+ * @param array $context An array representing the context
124
125
+ * @return array The context merged with the globals
126
+ */
127
+ public function mergeGlobals(array $context)
128
+ {
129
+ $context = parent::mergeGlobals($context);
130
+
131
+ // we don't use array_merge as the context being generally
132
+ // bigger than globals, this code is faster.
133
+ foreach ($this->app['view']->getShared() as $key => $value) {
134
+ if (!array_key_exists($key, $context)) {
135
+ $context[$key] = $value;
136
+ }
137
138
139
+ return $context;
140
141
142
/**
143
* Normalize a view name.
144
*
0 commit comments