We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Help converting to 2.x

Development and Programming

The Design Core's avatar
The Design Core
359 posts
15 years ago
The Design Core's avatar The Design Core

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;
  }
}
?>
       
The Design Core's avatar
The Design Core
359 posts
15 years ago
The Design Core's avatar The Design Core

I have tried looking at the code of some other plugins and tried a few things but keep getting a PHP error.

A PHP Error was encountered Severity: Notice Message: Trying to get property of non-object

Any help is appreciated.

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.