PhpOffice\PhpPresentation\Slide\SlideMaster::createSlideLayout PHP Method

createSlideLayout() public method

Create a slideLayout and add it to this presentation
public createSlideLayout ( ) : SlideLayout
return SlideLayout
    public function createSlideLayout()
    {
        $newSlideLayout = new SlideLayout($this);
        $this->addSlideLayout($newSlideLayout);
        return $newSlideLayout;
    }

Usage Example

Exemplo n.º 1
0
 public function testLayout()
 {
     $object = new SlideMaster();
     // Mock Post
     $mockSlideLayout = $this->getMockForAbstractClass('PhpOffice\\PhpPresentation\\Slide\\SlideLayout', array($object));
     $this->assertEmpty($object->getAllSlideLayouts());
     $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Slide\\SlideLayout', $object->createSlideLayout());
     $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Slide\\SlideLayout', $object->addSlideLayout($mockSlideLayout));
     $this->assertCount(2, $object->getAllSlideLayouts());
 }