1 | <?php |
||
27 | class BlockModalButton extends Widget |
||
28 | { |
||
29 | const ACTION_ENABLE = 'enable'; |
||
30 | const ACTION_DISABLE = 'disable'; |
||
31 | |||
32 | const SCENARIO_ENABLE = 'enable-block'; |
||
33 | const SCENARIO_DISABLE = 'disable-block'; |
||
34 | |||
35 | const EVENT_BEFORE_BODY = 'beforeBody'; |
||
36 | const EVENT_AFTER_BODY = 'afterBody'; |
||
37 | |||
38 | /** |
||
39 | * @var integer ID of action |
||
40 | * |
||
41 | * @see ACTION_DISABLE |
||
42 | * @SEE ACTION_ENABLE |
||
43 | */ |
||
44 | public $action; |
||
45 | |||
46 | /** |
||
47 | * @var Model |
||
48 | */ |
||
49 | public $model; |
||
50 | |||
51 | /** |
||
52 | * @var string |
||
53 | */ |
||
54 | public $scenario; |
||
55 | |||
56 | /** |
||
57 | * @var array|Modal stores the overriding options for [[ModalButton]]. |
||
58 | * After Modal creating, stores the object. |
||
59 | */ |
||
60 | public $modal = []; |
||
61 | |||
62 | /** |
||
63 | * @var string the validation URL, will be passed to [[ModalButton::form]] |
||
64 | * Default: `validate-form?scenario={$this->scenario}` |
||
65 | */ |
||
66 | public $validationUrl; |
||
67 | |||
68 | /** |
||
69 | * @var array block reasons. Should be a key-value array, will be passed to [[Html::dropDown]] |
||
70 | * Default: `Yii::$app->controller->getBlockReasons()` |
||
71 | */ |
||
72 | public $blockReasons; |
||
73 | |||
74 | /** |
||
75 | * @var array Options for trigger button. Will be passed to [[ModalButton::button]] |
||
76 | */ |
||
77 | public $button = []; |
||
78 | |||
79 | /** |
||
80 | * @var array Options to render the header of modal. |
||
81 | * Keys with special behaviour: |
||
82 | * - tag - html tag, used to wrap the header label (default: h4) |
||
83 | * - label - the value of tag |
||
84 | * |
||
85 | * All other options will be passed as third argument options to [[Html::tag]] |
||
86 | */ |
||
87 | public $header = []; |
||
88 | |||
89 | /** |
||
90 | * @var array Options to render the warning message inside of the modal. |
||
91 | * Keys with special behaviour: |
||
92 | * - tag - html tag, used to wrap the label (default: h4) |
||
93 | * - label - the value of tag |
||
94 | * |
||
95 | * All other options will be passed as third argument options to [[Html::tag]] |
||
96 | */ |
||
97 | public $warning = []; |
||
98 | |||
99 | /** |
||
100 | * @var array |
||
101 | */ |
||
102 | public $footer = []; |
||
103 | |||
104 | /** |
||
105 | * {@inheritdoc} |
||
106 | */ |
||
107 | public function init() |
||
112 | |||
113 | /** |
||
114 | * Configures options of widget. |
||
115 | */ |
||
116 | public function initOptions() |
||
192 | |||
193 | /** |
||
194 | * Begins modal. |
||
195 | * @throws \yii\base\InvalidConfigException |
||
196 | */ |
||
197 | protected function modalBegin() |
||
218 | |||
219 | /** |
||
220 | * Ends modal. |
||
221 | */ |
||
222 | protected function modalEnd() |
||
226 | |||
227 | /** |
||
228 | * Renders the body of the Modal. |
||
229 | * Triggers [[EVENT_BEFORE_BODY]] and [[EVENT_AFTER_BODY]] |
||
230 | * Set `$event->handled = true` to prevent default body render. |
||
231 | */ |
||
232 | protected function renderBody() |
||
258 | |||
259 | /** |
||
260 | * Renders widget. |
||
261 | */ |
||
262 | public function run() |
||
268 | } |
||
269 |
Since your code implements the magic getter
_get
, this function will be called for any read access on an undefined variable. You can add the@property
annotation to your class or interface to document the existence of this variable.If the property has read access only, you can use the @property-read annotation instead.
Of course, you may also just have mistyped another name, in which case you should fix the error.
See also the PhpDoc documentation for @property.