Bolt\Twig\Handler\AdminHandler::stack PHP Метод

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

Return an array with the items on the stack.
public stack ( array | string $types = [] ) : array
$types array | string
Результат array An array of items
    public function stack($types = [])
    {
        if (is_string($types)) {
            $types = array_filter(array_map('trim', explode(',', $types)));
        }
        $files = $this->app['stack']->getList($types);
        return $files;
    }

Usage Example

Пример #1
0
 public function testStack()
 {
     $app = $this->getApp();
     $stack = $this->getMockStack();
     $stack->expects($this->exactly(3))->method('getList')->withConsecutive([['other', 'document']], [['other', 'document']], [[]]);
     $app['stack'] = $stack;
     $handler = new AdminHandler($app);
     $handler->stack(['other', 'document']);
     $handler->stack('other, document');
     $handler->stack('');
 }