Home > callphp

callphp

Callphp is a project mainly written in PHP, it's free.

ExpressionEngine plugin allowing you to use php functions without allowing php in the template

Call PHP

A plugin for ExpressionEngine which allows you to use PHP in your templates without enabling php.

PHP functions are selected using the method param

method="str_replace"

You can add parameters to the function call by separating the params with a | you can optionally wrap the params in square braces [] if you want to preserve a space at the beginning of the string.

params="[param1|param2|param3]"

To replace all spaces in a string using str_replace use this. We are passing three params here the first is a space, the second is an empty string, the third is the string to search.

{exp:callphp method="str_replace" params="[ ||The quick brown fox jumped over the lazy dog" }

You can get the date like the

{exp:callphp method="date" params="m-d-Y"}

call strtotime

{exp:callphp method="strtotime" params="Monday January 1, 2011"}

You can also use the tag data as a param. When you use tag data it adds it as a param to the end of the array, therefore if you wanted to just use the tagdata you wouldn't declare the params in the tag.

{exp:callphp method="strtotime"}

Monday January 1, 2011 {/exp:callphp}

Previous:plier-api