File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change 33namespace Utilitte \Components \Rating ;
44
55use Nette \Application \UI \Control ;
6- use Nette \Security \User ;
76use Utilitte \Components \Rating \Model \RatingModelInterface ;
87use Utilitte \Components \Rating \ValueObject \Rating ;
98use Utilitte \Components \Utility \TControl ;
@@ -23,7 +22,6 @@ final class RatingComponent extends Control
2322 public function __construct (
2423 private RatingModelInterface $ model ,
2524 private Rating $ rating ,
26- private User $ user ,
2725 )
2826 {
2927 }
@@ -40,7 +38,7 @@ public function onVoted(callable $callback): void
4038 $ this ->onVoted [] = $ callback ;
4139 }
4240
43- public function render (): void
41+ public function render (mixed ... $ arguments ): void
4442 {
4543 $ template = $ this ->getTemplate ();
4644 $ template ->setFile ($ this ->getFile (__DIR__ . '/templates/rating.latte ' ));
@@ -53,6 +51,10 @@ public function render(): void
5351 $ template ->increase = $ this ->increase ;
5452 $ template ->canVote = $ this ->rating ->canVote ();
5553
54+ foreach ($ arguments as $ name => $ value ) {
55+ $ template ->$ name = $ value ;
56+ }
57+
5658 $ template ->render ();
5759 }
5860
You can’t perform that action at this time.
0 commit comments