Results 1 to 7 of 7
-
27th Jul 2010, 02:06 PM #1OPMemberWebsite's:
Doxsters.netparse if's in my template engine?
Does anyone have any good ways of parsing these if statements? Something like:
[if condition=this] blah blah
[/if]
Once that's done and i've coded the caching, my template engine will be done
But yeah, that's the only thing that's really annoying me atm, I can probably detect them with regex, but i don't really know how i'd parse them?timtamboy63 Reviewed by timtamboy63 on . parse if's in my template engine? Does anyone have any good ways of parsing these if statements? Something like: blah blah Once that's done and i've coded the caching, my template engine will be done :D But yeah, that's the only thing that's really annoying me atm, I can probably detect them with regex, but i don't really know how i'd parse them? Rating: 5
Need a Designer/Web Developer? Click Me
MSN: PM me for it.
Email(Preferred):timtamboy63@gmail.com
"Power Corrupts. Absolute Power Corrupts Absolutely"
-
27th Jul 2010, 02:30 PM #2MemberWebsite's:
litewarez.net litewarez.com triniwarez.comyou have to set up an array of comparison operators
array(
'=',
'>',
'<',
...
);
then you have to match the IF block like si
preg_match_all('/if\((?p<expr>)\{(?P<action>)\}/s');
then for the matched expr, you have to spit it up into () brackes so yo ucan do
[if 1 = 2 && 2 = 7 && ({var} == 88)]
[/endif]
[if <expr>]
<action>
[/[end|else]if] //Match this.Join Litewarez.net today and become apart of the community.
Unique | Clean | Advanced (All with you in mind)
Downloads | Webmasters
Notifications,Forum,Chat,Community all at Litewarez Webmasters
-
27th Jul 2010, 02:35 PM #3OPMemberWebsite's:
Doxsters.netyah, that bit isn't all that hard, what i can't work out how to do is get it to parse the if's
i can't replace it with php as it prints out the php in the source rather than executing it.
Need a Designer/Web Developer? Click Me
MSN: PM me for it.
Email(Preferred):timtamboy63@gmail.com
"Power Corrupts. Absolute Power Corrupts Absolutely"
-
27th Jul 2010, 02:37 PM #4MemberWebsite's:
litewarez.net litewarez.com triniwarez.comWhat do you mean by parse, if you matched them with regex you know what values have to be checked, if you check them and its logically true then parse and execute whats within the IF block.
Join Litewarez.net today and become apart of the community.
Unique | Clean | Advanced (All with you in mind)
Downloads | Webmasters
Notifications,Forum,Chat,Community all at Litewarez Webmasters
-
27th Jul 2010, 02:38 PM #5Respected Developer
That's why you need to cache your .tpl's to .php's.
-
27th Jul 2010, 02:42 PM #6MemberWebsite's:
litewarez.net litewarez.com triniwarez.comYea Hyperz, i think he means how to convert like so
Code:[set MyVariable=3] [if %MyVariable > 3] [require_once 'test.tpl'] [/if]
PHP Code:$MyVariable = 3;
if($MyVariable > 3):
$engine->require_once('test.tpl')
endif;
Join Litewarez.net today and become apart of the community.
Unique | Clean | Advanced (All with you in mind)
Downloads | Webmasters
Notifications,Forum,Chat,Community all at Litewarez Webmasters
-
28th Jul 2010, 01:37 AM #7OPMemberWebsite's:
Doxsters.netYeah exactly,, that cache thing that hyperz said would probably work right? Im just not too sure how i'd get it to work. Hm i'll take a look at it anyway
Need a Designer/Web Developer? Click Me
MSN: PM me for it.
Email(Preferred):timtamboy63@gmail.com
"Power Corrupts. Absolute Power Corrupts Absolutely"
Sponsored Links
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
[Selling] DataLife Engine English Warez Template
By peidahong in forum Completed TransactionsReplies: 1Last Post: 5th Aug 2010, 04:55 AM -
Trying to code my own template engine.
By timtamboy63 in forum Web Development AreaReplies: 15Last Post: 26th Jul 2010, 02:42 PM -
[Selling] Datalife Engine 8.5 Translated Template
By Last Word in forum Completed TransactionsReplies: 0Last Post: 9th Jul 2010, 09:34 AM -
[Selling] Datalife Engine Core Template (English)
By Last Word in forum Completed TransactionsReplies: 2Last Post: 5th Jul 2010, 05:39 AM -
How to translate datalife engine template?
By desibreaker in forum Webmaster DiscussionReplies: 6Last Post: 21st Dec 2009, 03:13 AM
themaLeecher - leech and manage...
Version 5.07 released. Open older version (or...