Newscoop\Service\Template::listItems PHP Метод

listItems() публичный Метод

Find items
public listItems ( string $path ) : Iterator
$path string
Результат Iterator
    public function listItems($path)
    {
        try {
            $items = array();
            foreach ($this->storage->listItems($path) as $file) {
                $items[] = $this->fetchMetadata("{$path}/{$file}");
            }
            return $items;
        } catch (\InvalidArgumentException $e) {
            throw new \InvalidArgumentException(sprintf("'%s' not found", $path), $e->getCode(), $e);
        }
    }

Usage Example

Пример #1
0
 public function getItemsAction()
 {
     $path = $this->parsePath();
     $this->view->items = $this->service->listItems($path);
 }