PHP

Evaluates PHP syntax within the page content.

0 stars out of 5

0 0 0 0 0
  • Author Taufik Nurrohman
  • Maintainer 1
  • Member
  • Version 1.1.1

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.