Welcome Guest, Not a member yet? Register   Sign In
Template Parser Class Improvement
#41

[eluser]Pascal Kriete[/eluser]
[quote author="m4rw3r" date="1210197327"]Or make your own Tongue[/quote]

If you have too much free time on your hands and gravitate to masochistic tendencies. I made this mistake and I'm still suffering.
#42

[eluser]m4rw3r[/eluser]
I created the first version of my template parser two years ago (when I look at the messy old code, I wonder how I got it to work :-) ), and I have remade it four times from scratch.

Next time I need another template parser, I think I'll use an existing one because now I know how much time it will take making a template parser from scratch.

I had nothing better to do (ok, I was 15 and had almost no homework so I had a lot of time), and finally I settled with the approach of Ruby's Radius tags (made a port of it in about 7-8 hours, and I had no understanding of Ruby before I started so it was a bit hard (I love challenges)), but remade it for PHP (had made a closure class which works very well, but I need to remove closures completely (which I lack time for Sad )). So now I have got a powerful template-parser Tongue.

(Maybe a bit heavy on ram because of all tags (one tag name = one function), but I think the speed is reasonable considering the flexibility)

Someday I will clean the code and release it on the forums, but I think I maybe can get some time during my summer vacation.
#43

[eluser]webshark[/eluser]
Hi,

I saw your code on the CodeIgniter forums:
http://ellislab.com/forums/viewthread/68878/#341795

I was wondering if a OR , AND statement can be used in the parsing class also?

Simon
#44

[eluser]rafsoaken[/eluser]
[quote author="webshark" date="1211747097"]Hi,

I saw your code on the CodeIgniter forums:
http://ellislab.com/forums/viewthread/68878/#341795

I was wondering if a OR , AND statement can be used in the parsing class also?

Simon[/quote]

No, you can only have simple if statements, no logical grouping. In short if the substitutions you need are found here: functionality of parser class / tests
you are good to go, if not, make it work and send me the patch Smile
#45

[eluser]webshark[/eluser]
After I started using this My_parser class certain vars that were working before stopped working.

For example:
Page rendering times and the used memory.. (built in codeigniter output)

Also the ReCaptcha for some reason isn't working

Any ideas why this could be happening?
#46

[eluser]rafsoaken[/eluser]
The only reason I can think of is some output buffering issue. I you find something out, please report back, thx.
#47

[eluser]Developer13[/eluser]
I love this mod, but has anybody set it up to do nested conditionals?

Example:

Code:
{if posts}

<h2>{post_title}</h2>

{if blah}do this{/if}

{/if}
#48

[eluser]JGarrido[/eluser]
So can anyone confirm this mod is pretty solid in it's current state?
#49

[eluser]Mirage[/eluser]
Message deleted - wrong thread. :red:
-m
#50

[eluser]Mirage[/eluser]
[quote author="Developer13" date="1214132447"]I love this mod, but has anybody set it up to do nested conditionals?[/quote]

I thought that's what this thread was all about?

Two alternatives come to mind

1. Wrap Smarty into a replacement of the bundled library, or create an alternative

2. Hang in there for EE2.0. Might be a bit risky, because we simply don't know how it'll affect CI. But if it's true that CI gets what EE needs then an enhanced template parser would have to part of it unless they do it in some custom library or elsewhere.

Cheers!




Theme © iAndrew 2016 - Forum software by © MyBB