I am working on a project using the Maizzle html-email framework that needs to have some php code embedded (but ignored) within the final production build file so that it can get later executed at runtime. Essentially I just want Maizzle to ignore the blocks of php code during the build process.
simplified code to ignore from component file that is included in main template file with the <component src="compname.html"></component>
tag.
...
<p>News for the Week of <rawcode class="rawcode"><?php echo $start_date ?> to <?php echo $end_date ?> from the following categories: <?php echo $cat01, $cat02, $cat03, $cat04 ?></rawcode></p>
...
code from config.production.js file
posthtml: {
plugins: [require('posthtml-custom-elements')()],
options: {
directives: [{ name: '?php', start: '<', end: '>' }],
},
expressions: {
ignoredTag: 'rawcode'
},
},
As long as the php code is directly within the main template file, I have been able to get this to work using the Raw tag to skip over expression parsing, as well as adding the posthtml-custom-elements directive to my config file using the example shown in the Maizzle documentation to skip ignore the php code.
The Problem: However, I cannot get this to work if the php code is within a component file that I have included within my template file. Any php code within a component file gets completely stripped out after running "maizzle production build".
I am hoping someone can help with a solution, or if this is just a limitation of how Maizzle works.