This project is not covered by Drupal’s security advisory policy.

Have you ever been typing out a big block of content with a WYSIWYG and really wanted to use a dynamic date or date range, or to use a link within your site but you know the subdirectory on the hostname will break links on your development sites? A simple PHP or Drupal function would get the job done nicely, but I don't want to have to write the whole page using the PHP Filter!

This module lets you embed a couple of simple PHP functions into your content without giving your IT department a heart attack.

Currently there are three functions supported:

  • format_date()
  • format_interval()
  • l()

The data is scrubbed and validated before being passed into the function to generate the PHP return value.

Modules may also hook into this filter by providing their own validation hook for a given php function.

If you have any other common functions that you would like to see incorporated, please submit them through the issue queue and I will try my best to integrate them. Even better, include a patch with your additions!

Use Cases

  • Explain a limiting date. "Your purchase with expire in 2 weeks on [php|format_date{+2 weeks|small}].
  • Show a rolling date range. "I began working for the company [php|format_interval{now|September 5, 2005|2}] ago."
  • Create a link that won't break if an alias or the hostname changes. "Read [About Me|about/me]."

Project information

Releases