Skip to content

Commit b3f535b

Browse files
author
NiallSmyth
committed
Removed addCssClassNames method from Control since it's identical to the same method provided by the parent Leaf class.
Moved addHtmlAttribute method from Control to Leaf since it's for working with the LeafModel which both classes use. Added remove methods for CSS classes and HTML attributes to Leaf.
1 parent 57ffcd4 commit b3f535b

File tree

2 files changed

+16
-11
lines changed

2 files changed

+16
-11
lines changed

src/Leaves/Controls/Control.php

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -64,16 +64,6 @@ public function setPlaceholderText($placeholderText)
6464
$this->model->addHtmlAttribute("placeholder", $placeholderText);
6565
}
6666

67-
public function addCssClassNames(...$classNames)
68-
{
69-
$this->model->addCssClassNames(...$classNames);
70-
}
71-
72-
public function addHtmlAttribute($attributeName, $attributeValue)
73-
{
74-
$this->model->addHtmlAttribute($attributeName, $attributeValue);
75-
}
76-
7767
/**
7868
* Returns a label that the hosting view can use in the HTML output.
7969
*

src/Leaves/Leaf.php

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -459,4 +459,19 @@ public function addCssClassNames(...$classNames)
459459
{
460460
$this->model->addCssClassNames(...$classNames);
461461
}
462-
}
462+
463+
public function removeCssClassNames(...$classNames)
464+
{
465+
$this->model->removeCssClassNames(...$classNames);
466+
}
467+
468+
public function addHtmlAttribute($attributeName, $attributeValue)
469+
{
470+
$this->model->addHtmlAttribute($attributeName, $attributeValue);
471+
}
472+
473+
public function removeHtmlAttribute($attributeName)
474+
{
475+
$this->model->removeHtmlAttribute($attributeName);
476+
}
477+
}

0 commit comments

Comments
 (0)