Skip to content

Commit

Permalink
Added passing params to the Widget class.
Browse files Browse the repository at this point in the history
  • Loading branch information
Maciej authored and Maciej committed Mar 31, 2015
1 parent 8f0842a commit 1b083d8
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions views/widget.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,14 @@
BrowserAsset::register($this);
JuiAsset::register($this);
}

echo Widget::widget([
'options'=> $options,
]);

$params = [];
$reflector = new ReflectionClass(Widget::className());
foreach($reflector->getProperties(ReflectionProperty::IS_PUBLIC) as $property) {
$name = $property->name;

if (isset(${$name})) {
$params[$name] = ${$name};
}
}
echo Widget::widget($params);

0 comments on commit 1b083d8

Please sign in to comment.