Skip to content

Commit f650c93

Browse files
committed
Add OL and UL lists
1 parent dc66ccc commit f650c93

File tree

6 files changed

+75
-0
lines changed

6 files changed

+75
-0
lines changed

src/WebApp/Component/ListItem.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?php
2+
3+
namespace WebApp\Component;
4+
5+
class ListItem extends Container {
6+
7+
public function __construct($parent, $child = NULL) {
8+
parent::__construct($parent, $child);
9+
}
10+
11+
}
12+

src/WebApp/Component/OrderedList.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?php
2+
3+
namespace WebApp\Component;
4+
5+
class OrderedList extends Container {
6+
7+
public function __construct($parent) {
8+
parent::__construct($parent);
9+
}
10+
11+
public function addItem($content = NULL) {
12+
return new ListItem($this, $content);
13+
}
14+
}
15+
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?php
2+
3+
namespace WebApp\Component;
4+
5+
class UnorderedList extends Container {
6+
7+
public function __construct($parent) {
8+
parent::__construct($parent);
9+
}
10+
11+
public function addItem($content = NULL) {
12+
return new ListItem($this, $content);
13+
}
14+
}
15+
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?php
2+
3+
namespace WebApp\DefaultTheme;
4+
5+
class ListItemRenderer extends ContainerRenderer {
6+
7+
public function __construct($theme, $component) {
8+
parent::__construct($theme, $component, 'li');
9+
}
10+
}
11+
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?php
2+
3+
namespace WebApp\DefaultTheme;
4+
5+
class OrderedListRenderer extends ContainerRenderer {
6+
7+
public function __construct($theme, $component) {
8+
parent::__construct($theme, $component, 'ol');
9+
}
10+
}
11+
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?php
2+
3+
namespace WebApp\DefaultTheme;
4+
5+
class UnorderedListRenderer extends ContainerRenderer {
6+
7+
public function __construct($theme, $component) {
8+
parent::__construct($theme, $component, 'ul');
9+
}
10+
}
11+

0 commit comments

Comments
 (0)