This extension should not be used on a site with multiple users. Other users may use this feature to perform malicious functions to break your system.
If you don’t like the Block evaluation method, you can use this extension to evaluate PHP expressions in a page file. It’s just that you have to write the page content as raw HTML, so you can’t combine this extension feature with Markdown extension and the like (unless you’re comfortable implementing the parser directly in your PHP code).
Usage
In your page header, add the type
property with the value set to PHP
or application/php
:
---
title: Page Title
description: Page description.
author: Taufik Nurrohman
type: PHP
...
<p>This is a <strong>bold</strong> text.</p>
<p>Today is <?= $date->i('%A, %B %d, %Y'); ?>.</p>
<p>
<?php
// Your PHP code goes here…
echo 'Yo!';
?>
</p>
<p>Other HTML code goes here.</p>
This extension is suitable to be used in combination with the Route extension.
0 Comments
No comments yet.