Skip to content

Commit 3b020f6

Browse files
committed
Update documentation
1 parent 841157e commit 3b020f6

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

docs/elements.rst

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -239,17 +239,15 @@ See ``Sample_09_Tables.php`` for more code sample.
239239
Images
240240
------
241241

242-
To add an image, use the ``addImage`` or ``addMemoryImage`` method. The
243-
first one is used when your source is stored locally, the later is used
244-
when your source is a remote URL, either another script that create
245-
image or an image on the internet.
246-
247-
Syntax:
242+
To add an image, use the ``addImage`` method to sections, headers, footers,
243+
textruns, or table cells.
248244

249245
.. code-block:: php
250246
251247
$section->addImage($src, [$style]);
252-
$section->addMemoryImage($link, [$style]);
248+
249+
- `source` String path to a local image or URL of a remote image
250+
- `styles` Array fo styles for the image. See below.
253251

254252
Examples:
255253

@@ -266,9 +264,10 @@ Examples:
266264
'wrappingStyle' => 'behind'
267265
)
268266
);
269-
270-
$section->addMemoryImage('http://example.com/image.php');
271-
$section->addMemoryImage('http://php.net/logo.jpg');
267+
$footer = $section->createFooter();
268+
$footer->addImage('http://example.com/image.php');
269+
$textrun = $section->createTextRun();
270+
$textrun->addImage('http://php.net/logo.jpg');
272271
273272
Image styles
274273
~~~~~~~~~~~~

0 commit comments

Comments
 (0)