slides_layout.rst 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. .. _slides_layout:
  2. Slides Layout
  3. =============
  4. A slide is a hierarchy of three components :
  5. - The master slide upon which the slide is based : it specifies such properties as the font styles for the title, body, and footer, placeholder positions for text and objects, bullets styles, and background ;
  6. - The slide layout which is applied to the the slide : it permits to override what is specified in the master slide ;
  7. - The slide itself : it contains content and formatting that is not already specified by the master slide and the slide layout
  8. Placeholders permit to link these three components together in order that the override is possible.
  9. Master slides
  10. -------------
  11. You can access to all master slides with the method ``getAllMasterSlides`` or create one with ``createMasterSlide``.
  12. .. code-block:: php
  13. $arraySlideMasters = $oPHPPresentation->getAllMasterSlides();
  14. $oMasterSlide = $oPHPPresentation->createMasterSlide();
  15. Slides Layout
  16. -------------
  17. You can access to all slide layout from a master with the method ``getAllSlideLayouts`` or create one with ``createSlideLayout``.
  18. .. code-block:: php
  19. $arraySlideLayouts = $oMasterSlide->getAllSlideLayouts();
  20. $oSlideLayout = $oMasterSlide->createSlideLayout();
  21. Placeholders
  22. ------------
  23. For each master slide or slide layout, you can add any shape like on a slide.
  24. .. code-block:: php
  25. $oShape = $oMasterSlide->createChartShape();
  26. $oShape = $oSlideLayout->createTableShape();
  27. You can define a shape as a placeholder for each level with the method ``setPlaceHolder``.
  28. A shape defined in each level will have an override for its formatting in each level.
  29. .. code-block:: php
  30. use PhpOffice\PhpPresentation\Shape\Placeholder;
  31. $oShape->setPlaceHolder(new Placeholder(Placeholder::PH_TYPE_TITLE));