Yosymfony\Spress\Core\DataWriter\MemoryDataWriter::getItem PHP Method

getItem() public method

This method is for internal use only and should never be called directly.
public getItem ( string $path ) : Yosymfony\Spress\Core\DataSource\ItemInterface
$path string Relative path of the content
return Yosymfony\Spress\Core\DataSource\ItemInterface
    public function getItem($path)
    {
        return $this->items[$path];
    }

Usage Example

Esempio n. 1
0
 public function testParseWithDrafts()
 {
     $dw = new MemoryDataWriter();
     $spress = new Spress();
     $spress['spress.config.site_dir'] = __DIR__ . '/fixtures/project';
     $spress['spress.config.drafts'] = true;
     $spress['spress.dataWriter'] = $dw;
     $spress->parse();
     $this->assertCount(18, $dw->getItems());
     $this->assertTrue($dw->hasItem('books/2013/09/19/new-book/index.html'));
     $this->assertContains('<!DOCTYPE HTML>', $dw->getItem('books/2013/09/19/new-book/index.html')->getContent());
 }
All Usage Examples Of Yosymfony\Spress\Core\DataWriter\MemoryDataWriter::getItem