Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Template&addContext()

  • Loading branch information...
commit a53b1f79d7120aca40ee8eef94de79bb6d431fc7 1 parent 4dc2f02
Brennen Bearnes authored
Showing with 12 additions and 0 deletions.
  1. +12 −0 Template.php
12 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 ()
Please sign in to comment.
Something went wrong with that request. Please try again.