add classes to lists
This commit is contained in:
parent
c81e9e8776
commit
f7d1949cc9
@ -66,19 +66,23 @@ abstract class View extends StaticView {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// UI Functions
|
// UI Functions
|
||||||
private function createList($items, $tag): string {
|
private function createList($items, $tag, $classes = ""): string {
|
||||||
if(count($items) === 0)
|
|
||||||
return "<$tag></$tag>";
|
$class = ($classes ? " class=\"$classes\"" : "");
|
||||||
else
|
|
||||||
return "<$tag><li>" . implode("</li><li>", $items) . "</li></$tag>";
|
if(count($items) === 0) {
|
||||||
|
return "<$tag$class></$tag>";
|
||||||
|
} else {
|
||||||
|
return "<$tag$class><li>" . implode("</li><li>", $items) . "</li></$tag>";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function createOrderedList($items=array()): string {
|
public function createOrderedList($items=array(), $classes = ""): string {
|
||||||
return $this->createList($items, "ol");
|
return $this->createList($items, "ol", $classes);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function createUnorderedList($items=array()): string {
|
public function createUnorderedList($items=array(), $classes = ""): string {
|
||||||
return $this->createList($items, "ul");
|
return $this->createList($items, "ul", $classes);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function createLink($link, $title=null, $classes=""): string {
|
protected function createLink($link, $title=null, $classes=""): string {
|
||||||
|
Loading…
Reference in New Issue
Block a user