Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
laravel-html-helper
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor statistics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
packages
laravel-html-helper
Commits
dfe132e1
Commit
dfe132e1
authored
6 years ago
by
Arthur LORENT
Browse files
Options
Downloads
Patches
Plain Diff
added trim for each detected class for classTag helper
parent
61a88bb3
Branches
Branches containing commit
Tags
1.0.2
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/HtmlHelper.php
+1
-1
1 addition, 1 deletion
src/HtmlHelper.php
tests/Unit/ClassTagTest.php
+2
-2
2 additions, 2 deletions
tests/Unit/ClassTagTest.php
with
3 additions
and
3 deletions
src/HtmlHelper.php
+
1
−
1
View file @
dfe132e1
...
...
@@ -42,7 +42,7 @@ class HtmlHelper implements Htmlable
.
gettype
(
$arg
)
.
' type given for « '
.
$arg
.
' » argument.'
);
}
}
$classArray
=
array_map
(
'trim'
,
$classArray
);
$this
->
htmlString
=
new
HtmlString
(
'class="'
.
implode
(
' '
,
$classArray
)
.
'"'
);
return
$this
;
...
...
This diff is collapsed.
Click to expand it.
tests/Unit/ClassTagTest.php
+
2
−
2
View file @
dfe132e1
...
...
@@ -15,7 +15,7 @@ class ClassTagTest extends HtmlhelperTestCase
'class1'
,
[
'class2'
,
'class3'
,
null
],
null
,
[
'class4'
,
[
'class5'
,
'class6Key'
=>
'class6'
]],
[
'class4'
,
[
'class5
'
,
'class6Key'
=>
'class6'
]],
7
);
$this
->
assertEquals
(
'class="class1 class2 class3 class4 class5 class6 7"'
,
$html
);
...
...
@@ -27,7 +27,7 @@ class ClassTagTest extends HtmlhelperTestCase
'class1'
,
[
'class2'
,
'class3'
,
null
],
null
,
[
'class4'
,
[
'class5'
,
'class6Key'
=>
'class6'
]],
[
'class4'
,
[
'class5
'
,
'class6Key'
=>
'class6'
]],
7
)
->
render
();
$this
->
assertEquals
(
'class="class1 class2 class3 class4 class5 class6 7"'
,
$html
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment