I am trying to to convert the HTML Entity that is returned by the {title} variable back into the character it is supposed to be. I am rendering the template in plain text so it isn’t going to be converted by the browser. I am writing a plug-in that would do this conversion in the template but am having a hard time finding out how to convert the specific value for the single quote.
The following is the value coming back in the {title} variable and doesn’t convert back:
echo html_entity_decode("’",ENT_QUOTES);This works:
echo html_entity_decode("'",ENT_QUOTES);Moved to Development and Programming by Moderator
I think this is exactly what I need, however it does lead me to another question. You’ll have to forgive me, I have yet to really develop any extensions for EE2 though I have done some with EE1.
My new question is now how do I go about using the CI code in my plugin? What is the proper way to leverage the CI helper inside my plugin? I have looked online, with little success, to find resources on how to do this. Thanks for all your help!
Jeremy
summitpr, Take a look here system\codeigniter\system\helpers\typography_helper.php
This does look like what I need, but I don’t know how to call the entity_decode method in that file. I think that is my last little hang-up I try to do it using $this->EE-typography->entity_decode($str); but it errors and says that it isn’t a method the other methods work, but I am clearly not following this for some reason…
Jeremy,
Have you looked through any CI tutorials? You can think of your plugin as basically a CI controller with a few more restrictions. But, you can load any available CI helpers or libraries, etc, with $this->EE->load->helper(‘helper_name’); or $this->EE->load->library(‘library_name’); etc.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.