[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4688: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4690: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4691: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4692: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
Webmasterplein.net • Toon onderwerp - [php] PHP-variables in templates
aan alle goede dingen komt een eind, webmasterplein.net 2003 - 2013
wij danken jullie voor al mooie momenten die dankzij dit forum ontstonden - Derk, Rutger en Stef

[php] PHP-variables in templates

Deel alles wat je delen kan, gebruik het voor opslag, plaats het omdat je er trots op bent of creƫer samen wat moois!

[php] PHP-variables in templates

Berichtdoor Rik » 09 mei 2008 20:04

Avatar gebruiker
Rik
wmpr
 
Berichten: 1576
Geregistreerd: 11 jun 2005 17:59

Re: [php] PHP-variables in templates

Berichtdoor libia » 09 mei 2008 20:21

ola, un cerveza por favor.


of
Avatar gebruiker
libia
wmpr
 
Berichten: 4149
Geregistreerd: 23 okt 2005 14:14
Woonplaats: Alphe!!

Re: [php] PHP-variables in templates

Berichtdoor Rik » 09 mei 2008 20:25

Ik heb zelf liever de mogelijkheid om PHP te gebruiken inplaats van een echte template parser. Ik maak ook vaak gebruik van Smarty op mijn werk. Die heeft pas functies zeg! Maar probeer ze maar eens te vinden, PHP ken ik wel, maar ik heb eigenlijk geen zin om ook nog eens Smarty te leren.
Avatar gebruiker
Rik
wmpr
 
Berichten: 1576
Geregistreerd: 11 jun 2005 17:59

Re: [php] PHP-variables in templates

Berichtdoor libia » 09 mei 2008 20:39

nou dit is gewoon libia-template :P

maar er valt niet zoveel aan te leren

- addVar = variabele toevoegen
- remVar = variabele verwijderen
- exec = alles verwerken

en de rest van de functionaliteit stop je rechtstreeks in de .tpl:
{var} = variabele
en als voorbeeld (zit hier niet in, maar wel in mijn complete versie):
<!--START IF(1 <= 5)-->
--code hier--
<!--END IF-->
<!--START ELSE-->
--code hier--
<!--END ELSE-->
(en zo ook meet de foreach en de include)

het voordeel van deze classe van mij is trouwens ook dat je geen functie nodig hebt om de waardes terug te krijgen, hij veranderd de aangewezen variabele :)
ola, un cerveza por favor.


of
Avatar gebruiker
libia
wmpr
 
Berichten: 4149
Geregistreerd: 23 okt 2005 14:14
Woonplaats: Alphe!!

Re: [php] PHP-variables in templates

Berichtdoor KillerSponge » 10 mei 2008 09:21

Ik ben fan van Bloe's methode, waarom een hele scriptingtaal uitvinden als je er al een tot je beschikking hebt :)
Blabla en andere onzin - http://killersponge.nl
Avatar gebruiker
KillerSponge
Beheerder
Beheerder
 
Berichten: 14456
Geregistreerd: 24 aug 2004 13:05

Re: [php] PHP-variables in templates

Berichtdoor frizzy » 10 mei 2008 09:26

Me 2...
frizzy
wmpr
 
Berichten: 4261
Geregistreerd: 20 sep 2006 16:03
Woonplaats: Boskoop :D

Re: [php] PHP-variables in templates

Berichtdoor ElbertF » 10 mei 2008 14:22

Je leert heel wat meer door 't zelf te doen. :)
Avatar gebruiker
ElbertF
wmpr
 
Berichten: 1310
Geregistreerd: 14 nov 2007 22:09

Re: [php] PHP-variables in templates

Berichtdoor Rik » 10 mei 2008 16:22

En daarom heb ik even snel gekeken naar de functie die ik had gevonden en daarna helemaal zelf weer herschreven. :)
Avatar gebruiker
Rik
wmpr
 
Berichten: 1576
Geregistreerd: 11 jun 2005 17:59


Keer terug naar Snippets



cron