Commit 4de20100 authored by Taylor Otwell's avatar Taylor Otwell

Merge pull request #862 from franzliedke/patch-15

[View] Pass variables with more expressive methods
parents 8198dc23 5e237381
......@@ -551,4 +551,20 @@ class View implements ArrayAccess {
return $this->render();
}
/**
* Magic Method for handling dynamic functions.
*
* This method handles calls to dynamic with helpers.
*/
public function __call($method, $parameters)
{
if (strpos($method, 'with_') === 0)
{
$key = substr($method, 5);
return $this->with($key, $parameters[0]);
}
throw new \Exception("Method [$method] is not defined on the View class.");
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment