99 self::FORM_TARGET_BLANK,
100 self::FORM_TARGET_PARENT,
101 self::FORM_TARGET_SELF,
102 self::FORM_TARGET_TOP
109 self::FORM_METHOD_POST,
110 self::FORM_METHOD_GET
117 self::FORM_ENC_TYPE_APPLICATION,
118 self::FORM_ENC_TYPE_MULTI_PART,
119 self::FORM_ENC_TYPE_PLAIN
126 self::BUTTON_TYPE_SUBMIT,
127 self::BUTTON_TYPE_BUTTON,
128 self::BUTTON_TYPE_RESET
145 throw new InvalidArgumentException(
146 "Please pass a value of type 'boolean' to specify whether the form is not to be validated when it is submitted"
168 if (!in_array(
$form_target, self::getValidFormTargets())) {
169 throw new InvalidArgumentException(
171 "Invalid form target passed, must be one of these: %s",
172 implode(
', ', self::getValidFormTargets())
192 if (!in_array(
$form_method, self::getValidFormMethods())) {
193 throw new InvalidArgumentException(
195 "Invalid form method passed, must be one of these: %s",
196 implode(
', ', self::getValidFormMethods())
217 throw new InvalidArgumentException(
219 "Invalid form enc type passed, must be one of these: %s",
220 implode(
', ', self::getValidFormEncTypes())
242 throw new InvalidArgumentException(
243 "The form action must be of type 'string'"
253 return $this->
form ??
'';
266 if (!is_string(
$form)) {
267 throw new InvalidArgumentException(
268 "The form id must be of type 'string'"
288 throw new InvalidArgumentException(
289 "The initial value of the button must be of type 'string'"
309 if (!is_string(
$name)) {
310 throw new InvalidArgumentException(
311 "The name of the button must be of type 'string'"
315 $this->name = $is_command ?
'cmd[' .
$name .
']' :
$name;
329 if (!in_array(
$button_type, self::getValidButtonTypes())) {
330 throw new InvalidArgumentException(
332 "Invalid button type passed, must be one of these: %s",
333 implode(
', ', self::getValidButtonTypes())
348 $attr[
'name'] = $this->
getName() ??
'';
349 $attr[
'value'] = $this->
getValue() ??
'';
350 $attr[
'form'] = $this->
getForm() ??
'';
358 $attr[
'rel'] =
'noopener';
form( $class_path, string $cmd, string $submit_caption="")