ExpressionEngine utility plugin to call php string processing function from template

The says it all. Sometime I need to process string from template using php functions, So I thought – it would be great if We’ve a plugin which will allow to call any php string processing functions from template. Thus I’ve created this simple plugin which does the job. I’m going to share this addon with you guys if you need it too. For example, you can call any available php function using following tag

{exp:util:func function="strip_tags" params="'<p><a>'"}<p>Test paragraph.</p><!-- Comment --> <a href="#fragment">Other text</a>{/exp:util:func}

You can even pass argument, if argument is a string, wrap this with a single/double quote, if argument is a constant, dont wrap with quote. Provide multiple params with pipe separator.

Here are the codes –

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.