FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
PHPWord/samples/Sample_23_TemplateBlock.php at develop · ynphp/PHPWord · GitHub
ynphp
PHPWord
Repository navigation
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
PHPWord
/
samples
/
Sample_23_TemplateBlock.php
Copy path
More file actions
More file actions
Latest commit
History
History
History
20 lines (15 loc) · 779 Bytes
Breadcrumbs
PHPWord
/
samples
/
Sample_23_TemplateBlock.php
Copy path
File metadata and controls
20 lines (15 loc) · 779 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<?php
include_once
'
Sample_Header.php
'
;
// Template processor instance creation
echo
date
(
'
H:i:s
'
) ,
'
Creating new TemplateProcessor instance...
'
,
EOL
;
$
templateProcessor
=
new
\
PhpOffice
\
PhpWord
\
TemplateProcessor
(
'
resources/Sample_23_TemplateBlock.docx
'
);
// Will clone everything between ${tag} and ${/tag}, the number of times. By default, 1.
$
templateProcessor
->
cloneBlock
(
'
CLONEME
'
,
3
);
// Everything between ${tag} and ${/tag}, will be deleted/erased.
$
templateProcessor
->
deleteBlock
(
'
DELETEME
'
);
echo
date
(
'
H:i:s
'
),
'
Saving the result document...
'
,
EOL
;
$
templateProcessor
->
saveAs
(
'
results/Sample_23_TemplateBlock.docx
'
);
echo
getEndingNotes
(
array
(
'
Word2007
'
=>
'
docx
'
),
'
results/Sample_23_TemplateBlock.docx
'
);
if
(!
CLI
) {
include_once
'
Sample_Footer.php
'
;
}
Back
|
FazBrowse Home
|
New Git URL