资 源 简 介
Collection of projects by Johan Nilsson
The Base Project currently contains the follwing classes.
Base_List
Base_List_Iterator
Base_List_Exception
Base_Iterator
Example usage:
```
// Dummy example object
class Item {
private $_name = "";
public function construct($name) { $this->name = $name; }
public function getName() { return $this->_name; }
}
$list = new Base_List();
$list->attach(new Item("a"))->attach(new Item("b"))->attach(new Item("c"));
$list->prepend(new Item("d"), "key")->prepend(new Item("e"));
echo $list->first()->getName() . "
";
echo $list->last()->getName() . "
";
foreach ($list as $item)
{
echo $item->getName() . "
";
}
echo count($list);
```