![]() |
Template Class Issues
Hey,
Okay, so, we have a template class (wrote from scratch) but the issue lies in the if statement parsing, the issue there is that if there's an if statement within an if statement (html if statement as in {if name='blah'}content{/endif} etc..) then the second if statement will get prematurely cut off, i think it's due to the regex on line 143. Any ideas anybody? Code: [nvm] Thanks! |
First thing that crosses my mind, is why you mix PHP5 with PHP4?
PHP Code:
|
Well, var is in PHP5 aswell you know? that's not the issue at all and what you said doesn't make sense.
|
Quote:
var is just an alias for public, but it would make more sense to use visibility keywords to keep your code consistent, as you have used them elsewhere. |
Hmm, okay, i admit that's a flaw with the script but, not that severe.
|
I'm not addressing the if statement issue because I feel that the template class needs to be rewritten. it needs a cache system, especially if the site will be large and have lots of forums/topics. Parsing LARGE quantities of data repeatedly would put a strain on the site's loading time.
|
I didn't say that it was a FLAW with that part. It was just a question, because TO ME it's weird to see them mixed. Sure it WORKS, but it's weird.
And I mean, if you use public function, then why not public $var ? And about that, in this case you should use private $output which would actually be better. |
Okay, Enfernikus: So, whenever you write any system, the first lines of code you write are for a cache system? That's pretty weird.
Tanax: Okay, yes, i agree with what you're saying and i will make sure i go through all the files and make changes as appropriate. Thanks. Any ideas on the if statement issue though? Thanks |
I do write my first lines of code with caching in mind, when ever doing any parsing or database related things.
|
It's quite hard to cache something that doesn't work properly anyway, so, anychance of going back on topic please? thanks.
|
Why do you want a template class if php is a template engine on it's own?
|
What are you even talking about?
|
Quote:
|
Quote:
PHP Code:
PHP Code:
PHP Code:
For if statements/loops etc just use PHP: PHP Code:
|
Okay, you're an idiot, it's offical, the reason people use template classes it to keep php and html seperate, with open source software someone could download a template with malicious php code in and they wouldn't know any different. All everyone in this topic has done is overlooked the problem, you're finding ways around it instead of finding a solution.
Can a moderator please close this topic? the people on this forum are incredibly stupid. |
I'll agree that the folks posting in this topic haven't directly commented on the original question. Some good points have been raised but they're not really related to what WinSrev's looking for, feel free to discuss those ideas (code consistency, caching, templating appropaches) in other topics but not here.
If anyone does have any comments on parsing the {if} blocks the they're very much welcome. P.S. WinSrev, please don't get upset if people can't stick to the topic at hand or take wider viewpoints than asked for. That's no reason to label the members of an entire forum as "incredibly stupid", however frustrating it is to have a question repeatedly ignored. |
Ok heres your solution: Smarty : Template Engine
I dont suppose you know of the old phrase: JFGI. I'll let you work that out O' clever one. Quote:
Quote:
If you had been a little nicer and less actually flaming me like a petty forum troll then I may have had a friendly debate with you on the subject, but currently I'd rather you grow up first. Ok, I'm done with you, I suggest you learn some manners before posting anything related to this forum, this isn't behavior people have in community and it isn't the attitude that I am willing to tolerate. |
JFGI = Just Fucking Google It.
If you don't find your answers here, just search for it yourself. I mean, if you're so lazy you can't even search for it, then don't get angry and upset when you don't get any response to the problem in here. |
Of course, because i had no idea google exist, i'm not sure how to use a search engine, can someone please advise me? thanks. And Smarty isn't the answer, what a fucking stupid thing to say.
(that was sarcasm) Can a moderator lock this topic please? thanks. |
Quote:
Would be a good idea to read: TalkPHP - Rules before making any further posts, specifically these rules perhaps: Quote:
Stop being so infantile. |
| All times are GMT. The time now is 08:23 PM. |
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0