Welcome Guest, Not a member yet? Register   Sign In
Very simple template parser (though just a bit better than CI's parser)
#1

[eluser]mvdg27[/eluser]
Hi guys,

I'm currently in the final stages of building my CMS, fully based on CodeIgniter. The back-end is all done, and now my focus has shifted to the front-end. The actual website itself.

For the front-end I was thinking of using a simple parser class, so users of the CMS an have easy to use pseudo-codes to incorporate in their website templates. I know that it's faster to simply use php codes, but I know my clients would feel way more comfortable using these pseudo-codes (and the client is always right, isn't it? Wink)

So today I started working with CI's parser class, but unfortunately it's not as good as I expected. It works great for the real basic stuff, like inserting a the title, keywords, description, and content of the page. But that's about it. Some thing I came across:

- the class can loop through an array, but doesn't work well if a key in the array also exists as a variable outside the array. This makes sense of course, but reduces the functionality. There should be an easy fix for this, I guess.
- the is no support for doing an if/else
- a for loop with count would be a nice extra feature

Now I've searched the forums, and I know that more people feel the parser class is lacking. I've also seen there are various template classes available on the forum. However, I think none of them are using pseudo-codes.

So now my question is, does anyone know of some good and simple template parsers that I might try to port to CI? I know there is Smarty, but I believe that it is way to complex for my needs. Really, I just want to provide a more simple interface to novice users. As soon as things start to become more complex, we'll be using PHP for that anyway.

Does anyone have some tips for me? A template parser that can do the things I mentioned above?

Thanks in advance, Michiel


Messages In This Thread
Very simple template parser (though just a bit better than CI's parser) - by El Forum - 01-16-2009, 10:30 AM



Theme © iAndrew 2016 - Forum software by © MyBB