Any chance anyone can help me convert this plugin to a 2.x version?
I am unsure of what needs to change.
The plugin replaces spaces with dashes, and converts a string to lowercase.
Thanks for any help or guidance!
<?php
$plugin_info = array(
'pi_name' => 'Dash Lower',
'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', // added a comma here
'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;
}
}
?>Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.