Parse CFML tags in PHP

Background

I have been using the site on the blogger platform for the past 5 years. I used the option of hosting the site on my own server, publishing via FTP. ColdFusion runs on my server, so I decided to take advantage of this. I created custom Coldfusion tags that provided additional features, and included those that were on many messages with messages - to be clear, the body of my messages. Google decided to disable access to this FTP publishing option. I took this news as an excuse for switching to WordPress. Now I have to figure out what to do with all of these ColdFusion tags in my posts.

Problem

I would not lose the functionality provided by custom tags that I have embedded in my posts. My main question is the best way to add functionality to a PHP site using custom tags? My initial plan was to try to parse the page to find tags, and then write a PHP class to basically mimic the functionality provided by the Coldfusion file. I don't know much about PHP, so I'm not sure what tools or libraries exist to facilitate this. Or if it's just a dumb idea. These are not well-formed XML files, so I need something pretty reliable.

An example :

I am using the following tag:

<cf_taglinks>Tag1, Tag2, Tag3</cf_taglinks> 

to generate a series of <a ..> <a..>Tag#</a> elements that reference technorati or something else that I decide (thus, the advantage of having my own tag is very easy to change the behavior). The solution to this problem can really handle any link, so if I have the <stackoverflowLink post="3944091"/> , I have to translate this into

 <a href="http://stackoverflow.com/posts/3944091/" target="_blank">Stackoverflow Question: 3944091</a> 
+1
coldfusion php parsing wordpress
source share
1 answer

Now I am leaning towards the custom tags mentioned in this post as an answer. One of the best features is support for hidden or nested tags, such as the code block below:

 <ct:upper type="all"> This text is transformed by the custom tag.<br /> Using the default example all the characters should be made into uppercase characters.<br /> Try changing the type attribute to 'ucwords' or 'ucfirst'.<br /> <br /> <ct:lower> <strong>ct:lower</strong><br /> THIS IS LOWERCASE TEXT TRANSFORMED BY THE ct:lower CUSTOM TAG even though it inside the ct:upper tag.<br /> <BR /> </ct:lower> </ct:upper> 

I highly recommend downloading the zip file and see the examples that it contains.

+1
source share

All Articles