1 | <?php |
||
8 | class PayButtonComment extends Widget |
||
9 | { |
||
10 | /** |
||
11 | * @var Event |
||
12 | */ |
||
13 | protected $event; |
||
14 | |||
15 | /** |
||
16 | * @var array |
||
17 | */ |
||
18 | public $commentViews = []; |
||
19 | |||
20 | /** |
||
21 | * PayButtonCommentHandler constructor |
||
22 | * @param Event $event The original event, triggered by [[hiqdev\yii2\merchant\widgets\PayButton]] |
||
23 | * @param array $config |
||
24 | */ |
||
25 | function __construct(Event $event, $config = []) |
||
31 | |||
32 | /** |
||
33 | * @inheritdoc |
||
34 | */ |
||
35 | public function init() |
||
41 | |||
42 | /** |
||
43 | * @inheritdoc |
||
44 | */ |
||
45 | public function run() |
||
49 | |||
50 | /** |
||
51 | * Array of default comment views |
||
52 | * @return array |
||
53 | */ |
||
54 | protected function getDefaultCommentViews() |
||
58 | |||
59 | /** |
||
60 | * Returns the view name for the specified $merchant |
||
61 | * @param string $merchant |
||
62 | * @return string|null |
||
63 | * @see commentViews |
||
64 | */ |
||
65 | public function getCommentView($merchant) |
||
69 | |||
70 | /** |
||
71 | * Method renders comment from the view, specified in |
||
72 | * @return string |
||
73 | */ |
||
74 | protected function renderComment() |
||
88 | |||
89 | /** |
||
90 | * Method provides the merchant name |
||
91 | * @return string |
||
92 | */ |
||
93 | protected function getMerchantName() |
||
97 | |||
98 | /** |
||
99 | * @return string the view path that may be prefixed to a relative view name. |
||
100 | */ |
||
101 | public function getViewPath() |
||
105 | } |
||
106 |
Adding explicit visibility (
private
,protected
, orpublic
) is generally recommend to communicate to other developers how, and from where this method is intended to be used.