From 86bbb5f187947202c30ed60b8a74a69b43320022 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Tue, 17 Jan 2012 13:32:04 -0600 Subject: [PATCH] added get and set magic methods. --- laravel/view.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/laravel/view.php b/laravel/view.php index 870d32f3..1795b9b6 100644 --- a/laravel/view.php +++ b/laravel/view.php @@ -353,6 +353,22 @@ public function offsetUnset($offset) unset($this->data[$offset]); } + /** + * Magic Method for handling dynamic data access. + */ + public function __get($key) + { + return $this[$key]; + } + + /** + * Magic Method for handling the dynamic setting of data. + */ + public function __set($key, $value) + { + $this[$key] = $value; + } + /** * Get the evaluated string content of the view. *