Skip to content

Commit

Permalink
do need __call
Browse files Browse the repository at this point in the history
  • Loading branch information
ShaneGlee committed Mar 20, 2019
1 parent 3b73800 commit 26f250d
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/Page.php
Original file line number Diff line number Diff line change
Expand Up @@ -167,4 +167,18 @@ public function render()
->with($this->with)
->render();
}

public function __call($name, $args)
{
if ($name == 'with') {
if (count($args) > 0) {
if (count($args) > 1) {
$name .= 'Named';
} else {
$name .= 'Array';
}
}
return call_user_func_array(array($this, $name), $args);
}
}
}

0 comments on commit 26f250d

Please sign in to comment.