westdc-zf1/application/admin/views/helpers/Breadcrumb.php

29 lines
1.0 KiB
PHP
Raw Normal View History

2009-03-06 03:20:46 +00:00
<?php
class Zend_View_Helper_breadcrumb extends Zend_View_Helper_Placeholder_Container_Standalone
{
public function breadcrumb ($title = null, $setType = Zend_View_Helper_Placeholder_Container_Abstract::APPEND)
{
if ($title) {
if ($setType == Zend_View_Helper_Placeholder_Container_Abstract::SET) {
$this->set($title);
} elseif ($setType == Zend_View_Helper_Placeholder_Container_Abstract::PREPEND) {
$this->prepend($title);
} else {
$this->append($title);
}
}
return $this;
}
public function toString ($indent = null)
{
$indent = (null !== $indent) ? $this->_getWhitespace($indent) : $this->getIndent();
$items = array();
foreach ($this as $item) {
$items[] = $item;
}
$separator = $this->_escape($this->getSeparator());
if (empty($separator)) $separator='->';
return $indent . implode($separator, $items);
}
}