1 | <?php |
||
24 | class ActiveForm extends \yii\widgets\ActiveForm |
||
25 | { |
||
26 | // Buttons align |
||
27 | const BUTTONS_ALIGN_LEFT = 'left'; |
||
28 | |||
29 | const BUTTONS_ALIGN_RIGHT = 'right'; |
||
30 | // Buttons position |
||
31 | const BUTTONS_POSITION_TOP = 'top'; |
||
32 | const BUTTONS_POSITION_BOTTOM = 'bottom'; |
||
33 | |||
34 | // Form type |
||
35 | const TYPE_HORIZONTAL = 'horizontal'; |
||
36 | const TYPE_VERTICAL = 'vertical'; |
||
37 | const TYPE_INLINE = 'inline'; |
||
38 | |||
39 | /** |
||
40 | * @var bool Indicates whether form rows is separated. |
||
41 | */ |
||
42 | public $separated = false; |
||
43 | |||
44 | /** |
||
45 | * @var bool Indicates whether form rows is stripped. |
||
46 | */ |
||
47 | public $stripped = false; |
||
48 | |||
49 | /** |
||
50 | * @var bool Indicates whether form rows is bordered. |
||
51 | */ |
||
52 | public $bordered = false; |
||
53 | |||
54 | /** |
||
55 | * @var string The default base class for the html form class attribute |
||
56 | */ |
||
57 | public $defaultClass = 'general-form'; |
||
58 | |||
59 | /** |
||
60 | * @var integer Set the full grid span |
||
61 | */ |
||
62 | public $fullSpan = 12; |
||
63 | |||
64 | /** |
||
65 | * @var integer Set the label grid span |
||
66 | */ |
||
67 | public $labelSpan = 3; |
||
68 | |||
69 | /** |
||
70 | * @var bool Indicates if form should be submitted using ajax |
||
71 | */ |
||
72 | public $ajax = true; |
||
73 | |||
74 | /** |
||
75 | * @var string ActiveForm type. |
||
76 | * Valid values are 'horizontal', 'vertical', 'inline' |
||
77 | */ |
||
78 | public $type = self::TYPE_VERTICAL; |
||
79 | |||
80 | /* @var boolean should all fields within the form be treated as non editable */ |
||
81 | public $editLocked = false; |
||
82 | |||
83 | /** |
||
84 | * |
||
85 | * @var array the [[ActiveForm]] buttons. |
||
86 | * Note that if are empty option 'items', then will not generated element is wrapped buttons. |
||
87 | * It is an array of the following structure: |
||
88 | * ```php |
||
89 | * [ |
||
90 | * //optional, horizontal align |
||
91 | * 'align' => ActiveForm::BUTTONS_POSITION_LEFT, |
||
92 | * //optional, vertical position |
||
93 | * 'position' => ActiveForm::BUTTONS_POSITION_BOTTOM, |
||
94 | * //optional, array of buttons |
||
95 | * 'items' => [ |
||
96 | * Button::widget('label' => 'Save', 'options' => ['type' => 'submit']), |
||
97 | * Button::widget('label' => 'Back'), |
||
98 | * ], |
||
99 | * // optional, the HTML attributes (name-value pairs) for the form actions tag. |
||
100 | * 'options' => ['class' => 'fluid'] |
||
101 | * ] |
||
102 | * ``` |
||
103 | */ |
||
104 | public $buttons = []; |
||
105 | |||
106 | /** |
||
107 | * |
||
108 | * @var array the default configuration used by [[field()]] when creating a new field object. |
||
109 | */ |
||
110 | public $fieldConfig = []; |
||
111 | |||
112 | /** |
||
113 | * |
||
114 | * @var bool indicates whether the tag 'form' is rendered. |
||
115 | * In case 'true' widget renders 'div' instead 'form'. |
||
116 | */ |
||
117 | public $fake = false; |
||
118 | |||
119 | |||
120 | /** |
||
121 | * Initializes the widget. |
||
122 | * This renders the form open tag. |
||
123 | */ |
||
124 | public function init() |
||
188 | |||
189 | |||
190 | /** |
||
191 | * Runs the widget. |
||
192 | * This registers the necessary javascript code and renders the form close tag. |
||
193 | */ |
||
194 | public function run() |
||
212 | |||
213 | |||
214 | /** |
||
215 | * Generates a form field. |
||
216 | * A form field is associated with a model and an attribute. It contains a label, an input and an error message |
||
217 | * and use them to interact with end users to collect their inputs for the attribute. |
||
218 | * |
||
219 | * @param Model $model |
||
220 | * the data model |
||
221 | * @param string $attribute |
||
222 | * the attribute name or expression. See [[Html::getAttributeName()]] for the format |
||
223 | * about attribute expression. |
||
224 | * @param array $options |
||
225 | * the additional configurations for the field object |
||
226 | * @return ActiveField the created ActiveField object |
||
227 | * @see fieldConfig |
||
228 | */ |
||
229 | public function field($model, $attribute, $options = []) |
||
233 | |||
234 | |||
235 | protected function renderActions($currentPosition) |
||
265 | |||
266 | /** |
||
267 | * Check if form has been set as edit locked |
||
268 | * |
||
269 | * @return boolean |
||
270 | */ |
||
271 | public function isEditLocked() |
||
275 | } |
||
276 | |||
277 |
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.