Welcome Guest, Not a member yet? Register   Sign In
Parse custom html tags?
#1

[eluser]mscahill[/eluser]
I took a look at CI's template parser, but this isn't going to fit my need on this project. I need to parse my custom tags before they ever get to the view. Here's an example of what I'm looking to do:

A custom tag like this would load a resultset into an array:
Code:
<query variable='users'>SELECT * FROM users</query>

Then a result (the username for user with ID of 12) could be accessed like so:
Code:
<var:users row='12' col='user_name' />
output:
Code:
Bobby

I would also need a tag like this to forward to my drilldown controller:
Code:
<drilldown name='user' value='Bobby'>Bobby</drilldown>
output:
Code:
<a href='http://example.com/drilldown/user/Bobby'>Bobby</a>

Any ideas? I've looked at regex, PHP DOM, etc. but don't know how I would accomplish something like this.


Messages In This Thread
Parse custom html tags? - by El Forum - 01-21-2009, 08:45 AM
Parse custom html tags? - by El Forum - 01-21-2009, 09:10 AM
Parse custom html tags? - by El Forum - 01-21-2009, 09:20 AM
Parse custom html tags? - by El Forum - 01-21-2009, 11:32 AM
Parse custom html tags? - by El Forum - 01-21-2009, 11:34 AM
Parse custom html tags? - by El Forum - 01-23-2009, 12:25 AM



Theme © iAndrew 2016 - Forum software by © MyBB