Q Qodex Member Feb 9, 2012 374 36 Jul 19, 2012 #1 Hey guys, I was wondering how do I set a param. I have looked on Google and PHP.net but I can't anything. I want it when I go echo {example} for instance I want it to go 'Hello'. Thanks
Hey guys, I was wondering how do I set a param. I have looked on Google and PHP.net but I can't anything. I want it when I go echo {example} for instance I want it to go 'Hello'. Thanks
Livar Now 35% cooler! Oct 15, 2010 846 86 Jul 19, 2012 #2 First of all, it's not as simple as that my friend, it requires a template system, there are many but the best is: You must be registered for see links Upvote 0 Downvote
First of all, it's not as simple as that my friend, it requires a template system, there are many but the best is: You must be registered for see links
Quackster a devbest user says what Aug 22, 2010 1,765 1,245 Jul 19, 2012 #3 Code: <?php $contents = file_get_contents('file'); $contents = str_replace("{param}", "param lulz", $contents); echo $contents; ?> There. Upvote 0 Downvote
Code: <?php $contents = file_get_contents('file'); $contents = str_replace("{param}", "param lulz", $contents); echo $contents; ?> There.
Q Qodex Member Feb 9, 2012 374 36 Jul 19, 2012 Thread starter #4 Like a TPL file? (I was looking at snippets from CookieMS and it said something like TPL ) Upvote 0 Downvote
Quackster a devbest user says what Aug 22, 2010 1,765 1,245 Jul 19, 2012 #5 It's simple. Grab content from file. Use str_replace. Done. Upvote 0 Downvote
Markshall Русский Стандарт Contributor Dec 18, 2010 2,638 2,393 Jul 19, 2012 #6 I remember You must be registered for see links posting a tutorial on it, You must be registered for see links . However, this uses '[param]' not '{param}' but it will take you no more than 3 seconds to change that. Upvote 0 Downvote
I remember You must be registered for see links posting a tutorial on it, You must be registered for see links . However, this uses '[param]' not '{param}' but it will take you no more than 3 seconds to change that.
TesoMayn Boredom, it vexes me. Oct 30, 2011 1,482 1,482 Jul 19, 2012 #7 Yes, very easy, as You must be registered for see links has linked you to a simple system I posted, but his link is broken, so here. You must be registered for see links Upvote 0 Downvote
Yes, very easy, as You must be registered for see links has linked you to a simple system I posted, but his link is broken, so here. You must be registered for see links
Q Qodex Member Feb 9, 2012 374 36 Jul 20, 2012 Thread starter #8 m0nsta. said: I remember You must be registered for see links posting a tutorial on it, You must be registered for see links . However, this uses '[param]' not '{param}' but it will take you no more than 3 seconds to change that. Click to expand... How would I change it? Upvote 0 Downvote
m0nsta. said: I remember You must be registered for see links posting a tutorial on it, You must be registered for see links . However, this uses '[param]' not '{param}' but it will take you no more than 3 seconds to change that. Click to expand... How would I change it?
Markshall Русский Стандарт Contributor Dec 18, 2010 2,638 2,393 Jul 21, 2012 #9 I've fixed the link now. And where it says '[' and ']' just change it to { and }... Upvote 0 Downvote
TesoMayn Boredom, it vexes me. Oct 30, 2011 1,482 1,482 Jul 21, 2012 #10 Change PHP: $this->template = str_replace("[$var]", $content, $this->template); to PHP: $this->template = str_replace("{$var}", $content, $this->template); Upvote 0 Downvote
Change PHP: $this->template = str_replace("[$var]", $content, $this->template); to PHP: $this->template = str_replace("{$var}", $content, $this->template);