(I’m developing locally and don’t have a license yet, so can’t post in the plugins section..)
<?php
$plugin_info = array(
'pi_name' => 'DashLower',
'pi_version' => '1.0',
'pi_author' => 'N David Brown',
'pi_author_url' => 'http://www.buildingfrombelow.org/',
'pi_description' => 'Replaces spaces with dashes, and converts a string to lowercase',
'pi_usage' => DashLower::usage()
);
class DashLower
{
function DashLower()
{
global $TMPL;
$this->return_data = strtolower(str_replace(' ', '-', $TMPL->tagdata));
}
// ----------------------------------------
// Plugin Usage
// ----------------------------------------
// This function describes how the plugin is used.
// Make sure and use output buffering
function usage()
{
ob_start();
?>
{exp:dashlower}your_text{/exp:dashlower}
<?php
$buffer = ob_get_contents();
ob_end_clean();
return $buffer;
}
}
?>Save it as pi.dashlower.php in your plugins dir, then use it like
{exp:dashlower}{workProject}{/exp:dashlower}