Templates |
[eluser]Phil Sturgeon[/eluser]
Right, give the malware stuff a rest guys, the link has been removed so it no longer matters. Quote:1) The Template Parser: I want to enable my users to upload their own templates. Can standard PHP be processed from the templates, or only the {} variables get processed? I’m really hoping you’ll say “NO, PHP can’t be run from templates” as it can be a real pain from a security aspect (allowing users to upload files with potential malicious code). Yes it can be run but just pass your content through encode_php_tags() within the security_helper.php and these will be encoded as HTML entities (and will appear as plain text to the user). Quote:2) Functions within templates: Anyone managed to modify the Template Parser class to enable “template functions”? E.g. if {me} is a variable, something like {fn do_something “parameter1” “parameter2”} I was playing about with a prototype for this last week. I called it HelpfulParser Quote:3) How do you go about caching templates? $this->output->set_output() to cache the whole thing, or save the finished content in a text file on the server somewhere when done.
[eluser]IvanBernat[/eluser]
Phil, I was about to completely forget CI because of all the trolling here, but you changed my mind :-) Your parser is just what I was looking for!
[eluser]Phil Sturgeon[/eluser]
I'm glad to see my post survived the mass eradication here. I sense Mr. Wales at work. :coolsmile: Let me know how it goes using the Template Parser. Even with the features I have enabled through my extended library, this Parser is still WAY too weak for me to ever use on internal files OR admin submitted content. It's a shame really.
|
Welcome Guest, Not a member yet? Register Sign In |