Skip to content

Commit

Permalink
Merge pull request #395 from fr3nch13/master
Browse files Browse the repository at this point in the history
Fixes #394 - Removes role="form" from form tags.
  • Loading branch information
ADmad authored Oct 21, 2023
2 parents 139c7d9 + ae23758 commit 61ae882
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 10 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,4 @@ webroot/js/*
nbproject/*
# Visual Studio Code
.vscode
.DS_Store
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ echo $this->Form->end();
will render this HTML:

```html
<form method="post" accept-charset="utf-8" role="form" action="/articles/add">
<form method="post" accept-charset="utf-8" action="/articles/add">
<!-- ... -->
<div class="mb-3 form-group text">
<label class="form-label" for="title">Title</label>
Expand Down Expand Up @@ -365,7 +365,7 @@ echo $this->Form->end();
It will render this HTML:

```html
<form method="post" accept-charset="utf-8" class="form-horizontal" role="form" action="/articles/add">
<form method="post" accept-charset="utf-8" class="form-horizontal" action="/articles/add">
<!-- ... -->
<div class="mb-3 form-group row text">
<label class="col-form-label col-md-4" for="title">Title</label>
Expand Down Expand Up @@ -413,7 +413,7 @@ echo $this->Form->end();
It will render this HTML:

```html
<form method="post" accept-charset="utf-8" class="form-horizontal" role="form" action="/articles/add">
<form method="post" accept-charset="utf-8" class="form-horizontal" action="/articles/add">
<!-- ... -->
<div class="mb-3 form-group row text">
<label class="col-form-label col-sm-6 col-md-4" for="title">Title</label>
Expand Down Expand Up @@ -459,7 +459,7 @@ echo $this->Form->end();
will render this HTML:

```html
<form method="post" accept-charset="utf-8" class="form-inline" role="form" action="/articles/add">
<form method="post" accept-charset="utf-8" class="form-inline" action="/articles/add">
<!-- ... -->
<div class="form-group text">
<label class="form-label visually-hidden" for="title">Title</label>
Expand Down
1 change: 0 additions & 1 deletion src/View/Helper/FormHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,6 @@ public function create(mixed $context = null, array $options = []): string
{
$options += [
'class' => null,
'role' => 'form',
'align' => null,
'templates' => [],
'spacing' => null,
Expand Down
5 changes: 0 additions & 5 deletions tests/TestCase/View/Helper/FormHelperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,6 @@ public function testFormCreate()
'form' => [
'method' => 'post',
'accept-charset' => 'utf-8',
'role' => 'form',
'action' => '/articles/add',
],
];
Expand Down Expand Up @@ -654,7 +653,6 @@ public function testInlineFormCreate()
'form' => [
'method' => 'post',
'accept-charset' => 'utf-8',
'role' => 'form',
'action' => '/articles/add',
'class' => 'form-inline row g-3 align-items-center',
],
Expand All @@ -672,7 +670,6 @@ public function testInlineFormCreateWithCustomSpacing()
'form' => [
'method' => 'post',
'accept-charset' => 'utf-8',
'role' => 'form',
'action' => '/articles/add',
'class' => 'form-inline row custom-spacing align-items-center',
],
Expand All @@ -687,7 +684,6 @@ public function testHorizontalFormCreate()
'form' => [
'method' => 'post',
'accept-charset' => 'utf-8',
'role' => 'form',
'action' => '/articles/add',
'class' => 'form-horizontal',
],
Expand Down Expand Up @@ -788,7 +784,6 @@ public function testHorizontalFormCreateFromConfig()
'form' => [
'method' => 'post',
'accept-charset' => 'utf-8',
'role' => 'form',
'action' => '/articles/add',
'class' => 'form-horizontal',
],
Expand Down

0 comments on commit 61ae882

Please sign in to comment.