COMPER Template Parser 2 (NEW 2.5 Beta is out!) |
[eluser]Tominator[/eluser]
@imamiscool: Sure, it's possible, you can use append function. More information in docs: http://parser.comper.sk/en/docs/ci/#data If you want to make a cycle from multi-dimensional array, you can use our cycle system: http://parser.comper.sk/en/docs/ci/#cycle @Ocycath: In fact, you can "cheat" ![]() Code: foreach ($query->result() as $category) And TPL will be: Code: <!-- BEGIN Category_Cycle --> {ID} will be ID of the category. I hope my explanation is clear ![]() Tom.
[eluser]Ocycath[/eluser]
thank you very much Tominator, strange solution but it is working! ![]() ![]() Thank you again
[eluser]Tominator[/eluser]
Welcome in family ![]() ![]()
[eluser]imamiscool[/eluser]
[quote author="Tominator" date="1301941566"]@imamiscool: Sure, it's possible, you can use append function. More information in docs: http://parser.comper.sk/en/docs/ci/#data If you want to make a cycle from multi-dimensional array, you can use our cycle system: http://parser.comper.sk/en/docs/ci/#cycle @Ocycath: In fact, you can "cheat" ![]() Code: foreach ($query->result() as $category) And TPL will be: Code: <!-- BEGIN Category_Cycle --> {ID} will be ID of the category. I hope my explanation is clear ![]() Tom.[/quote] Thanks for your reply, but I think cycle for multidimensional array is important feature for your parser library... Because doing some cheat like {ID} will make another team's member become confuse, and it will make your code (on PHP side) dirty... The basic parser on codeIgniter provide that, why don't you provide that? maybe for the next release.. It just my opinion. Thank you, ![]()
[eluser]Tominator[/eluser]
It's impossible to 'solve'. For each category, there are another data of products in PHP. But you are making array ($data) in loop, that's why it's replacing, and after cycle you have data only from last loop in final array. Than you pass this array to Parser ... Solution is in making specific arrays by adding some dynamic infomation like ID ![]()
[eluser]Tominator[/eluser]
My testers are lazyyy (very very busy) ![]() I cannot wait any longer, I want to release new version. Right now I have RC3, try to find some bugs in it. What's new? - Just 4 regexps for conditions. Great with combination with cycles (version 2.0 was slowly). So speed is improved by about 60-70% (more conditions, more percentage) - Conditions supports PHP functions. In fact just some of functions, because you are working with strings not variables. That mean, you cannot use empty function. Instead you can use strlen("{variable}" > 0). Parser is still backward compatile, so you can try, and test and I hope it will be useful for you - Support for CSRF protection added - in fact I check how native CSRF protection works in CI, and I tried to make it compatible with Parser. It's buggy for me, but may not be for you ![]() - Support for dynamic paths. I hope it finally solve problem with HMVC environments Usage Dynamic paths: Code: $config['path'] = '%apppath%/views/'; CSRF: http://ellislab.com/codeigniter/user-gui...urity.html Download OK and Parser 2.1 RC3 itself is attached to this post. I hope it make your work much easier! When this version proves to be stable I will make update in project's homepage. Tom
[eluser]toopay[/eluser]
BEH! This pretty awesome. Simple, but so efficient. I just start to think to write some library to handle templating stuff like yours, but i think your lib has been make it done. And it seems you prepared all well, from documentation, even you provide a site for that. Are you have some plan, to put your lib on Git or Bitbucket? I'll love to share my time on it :-) In my opinion, is we (lol) use some regex stuff, we can parsing some html tag, with pseudo variable like : Code: <img src="/path/to/file/somefilename" title="sometitle" width="100px" height="100px" class="someclass" />
[eluser]Tominator[/eluser]
In fact I using Springsloop for my personal usage, it has SNV, GTD and lot of stuff. Maybe someday, I'll move my project to Git or Bitbucket, but I need good reason for this ('cause I just love Springloops). Your help will be great, I trying to make parser as simple as possible and in the another hand very powerful. I don't think that making some 'cool' features like generating HTML will make parser better. I mean, it's not really necessary and it won't save lot of time, but some programmers will have to read longer docs ![]() ![]() ![]() So if you want to make parser better, than use it, test it, and if you have good idea, write ... or make it happen ![]() Tom.
[eluser]toopay[/eluser]
More atractive, more fun right? We, as php developer, in my opinion, should have a some way, to make our jobs not boring :-) I have a db helper, which allow me to write SQL into something like... Code: $this->dbhelper->select_id_from_user('1'); I occasionally use springloop too, but i think its intend to use on private or commercial project (even its allow open source too). But for open-source, Github or Bitbucket is more popular. Anyway, its not the big deal, just tell me if you make it open ;-)
[eluser]Romyblack[/eluser]
[quote author="Tominator" date="1304196988"]My testers are lazyyy (very very busy) ![]() CSRF: http://ellislab.com/codeigniter/user-gui...urity.html Download OK and Parser 2.1 RC3 itself is attached to this post. I hope it make your work much easier! When this version proves to be stable I will make update in project's homepage. Tom[/quote] Hi tominator, thanx and congratz for this incredible library, im trying to download the 2.1 version to test it but the link you've provided does not work. would you mind posting another link please ? |
Welcome Guest, Not a member yet? Register Sign In |