Permalink
Browse files

Template&addContext()

  • Loading branch information...
1 parent 4dc2f02 commit a53b1f79d7120aca40ee8eef94de79bb6d431fc7 Brennen Bearnes committed Oct 5, 2012
Showing with 12 additions and 0 deletions.
  1. +12 −0 Template.php
View
@@ -129,6 +129,18 @@ public function setContext ($context = array())
}
/**
+ * Add a set of values to existing context. Overwrites existing values
+ * if the given ones happen to overlap, leaves existing ones in place.
+ */
+ public function addContext ($context = array())
+ {
+ foreach ($context as $key => $val) {
+ $this->__set($key, $val);
+ }
+ return $this;
+ }
+
+ /**
* Return a copy of the entire context array.
*/
public function getContext ()

0 comments on commit a53b1f7

Please sign in to comment.