Re: [PHP] template solutions?
WML is an easier solution (search freshmeat for wml - website meta language). Anuradha On Sun, 29 Apr 2001, Steven Haryanto wrote: > Does anyone know a rather advanced template solution in PHP? > At least one that supports loop and if (like HTML::Template), > and directives/commands would be nice (like Perl's Template > Toolkit). > > I am currently rolling my own, but still not happy with the > result of the design. I'd be happy to use one that is already > out there. > > Steve > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] template solutions?
At 5/1/2001 06:49 PM, Michael Kimsal wrote: >The 'security' angle is the only one I consider terribly valid, an was >what I had in mind when I said I can't think of too many reasons why a >packaged' template' solution is in order. Obviously it is for you. > >I still believe that in most cases it doesn't make much sense to use one, >for most people, because it's limiting you to a subset of a powerful >language, and the implementation can be slower. Smarty is on the right >track by compiling the templates to PHP and cacheing them. > >What I'd *love* to see is a template system which is portable between >various platforms (JSP, CF, PHP, Perl, VBScript). That would, imo, make >it worhtwhile for people to learn *one* templating system that would be >cross-platform. That is where a template system like HTML::Template excels, actually. It is very simple to implement it in Perl, PHP, Tcl, etc etc. Steve -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] template solutions?
Cool. I didn't know that. Does FastTemplate support nested loop and ifs? Steve At 5/1/2001 10:33 PM, Henning Kilset Pedersen wrote: >Fasttemplate supports loops and if's. > >You set a dynamic block like so: > > > > {ROWCONTENT} > > > >And then in the PHP code that parses this html template (.tpl, for example) >file, you do a $tpl->assign (.ROWCONTENT, "rowdata"); > >and loop over that. the .ROWCONTENT means that you're ADDING data to a >variable that already exists. Replace "rowdata" with the data for the row in >question. > >Isn't this what you want?? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] template solutions?
Fasttemplate supports loops and if's. You set a dynamic block like so: {ROWCONTENT} And then in the PHP code that parses this html template (.tpl, for example) file, you do a $tpl->assign (.ROWCONTENT, "rowdata"); and loop over that. the .ROWCONTENT means that you're ADDING data to a variable that already exists. Replace "rowdata" with the data for the row in question. Isn't this what you want?? Regards, -- Henning Kilset Pedersen Anarchy Online Server Operations Oracle, PHP, e-Commerce etc. Funcom Oslo AS -Original Message- From: Steven Haryanto [mailto:[EMAIL PROTECTED]] Sent: 30. april 2001 21:09 To: Fabian Raygosa; [EMAIL PROTECTED] Subject: Re: [PHP] template solutions? At 5/1/2001 01:43 AM, Fabian Raygosa wrote: >Maybe this is what you are looking for >http://www.thewebmasters.net/php/FastTemplate.phtml Nope. I was looking for a template that supports loops and IFs. Someone pointed me to php dreamtime: http://www.phptemplates.org/ which is a cool project, by the way. Btw, I think I might need some extra "tags" to my template "language" so I'm going to hack this on by myself at the time being. Thanks, Steve -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] template solutions?
Nope, it doesn't support nested loops (or dynamic blocks, as it's called now). But PHPLib templates supports this. PHPlib covers a lot of other stuff as well, but I haven't bothered to take a look at that yet, as Fasttemplate is good enough for my use ;-) http://phplib.netuse.de is their URL. Regards, -- Henning Kilset Pedersen Anarchy Online Server Operations Oracle, PHP, e-Commerce etc. Funcom Oslo AS phone + 47 22 92 58 40 cell + 47 91 66 40 30 email [EMAIL PROTECTED] -Original Message- From: Steven Haryanto [mailto:[EMAIL PROTECTED]] Sent: 1. mai 2001 17:50 To: Henning Kilset Pedersen; 'Fabian Raygosa'; [EMAIL PROTECTED] Subject: RE: [PHP] template solutions? Cool. I didn't know that. Does FastTemplate support nested loop and ifs? Steve At 5/1/2001 10:33 PM, Henning Kilset Pedersen wrote: >Fasttemplate supports loops and if's. > >You set a dynamic block like so: > > > > {ROWCONTENT} > > > >And then in the PHP code that parses this html template (.tpl, for example) >file, you do a $tpl->assign (.ROWCONTENT, "rowdata"); > >and loop over that. the .ROWCONTENT means that you're ADDING data to a >variable that already exists. Replace "rowdata" with the data for the row in >question. > >Isn't this what you want?? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] template solutions?
The 'security' angle is the only one I consider terribly valid, an was what I had in mind when I said I can't think of too many reasons why a packaged' template' solution is in order. Obviously it is for you. I still believe that in most cases it doesn't make much sense to use one, for most people, because it's limiting you to a subset of a powerful language, and the implementation can be slower. Smarty is on the right track by compiling the templates to PHP and cacheing them. What I'd *love* to see is a template system which is portable between various platforms (JSP, CF, PHP, Perl, VBScript). That would, imo, make it worhtwhile for people to learn *one* templating system that would be cross-platform. On Tue, 1 May 2001, Christian Reiniger wrote: > On Monday 30 April 2001 21:02, Steven Haryanto wrote: > > At 5/1/2001 01:43 AM, Michael Kimsal wrote: > > >I understand completely what you're getting at already, but PHP is > > >designed to do what you're asking to do. > > > > > >I know there are valid reaons for stripped down implementations, but > > > can't think of too many. > > > > Clean separation of content and presentation? That is one strong > > point (for some people anyway). > > Well, whether you write > Hello , how are you? > or > Hello {{ USER }}, how are you? > > doesn't really matter I'd say. > > > Ease of use? I want to let *other people* customize the web page to > > some extent, but surely do not want to require them to learn PHP. > > Also in this regard. > > -- > Christian Reiniger > LGDC Webmaster (http://sunsite.dk/lgdc/) > > CPU not found. retry, abort, ignore? > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] template solutions?
On Monday 30 April 2001 21:02, Steven Haryanto wrote: > At 5/1/2001 01:43 AM, Michael Kimsal wrote: > >I understand completely what you're getting at already, but PHP is > >designed to do what you're asking to do. > > > >I know there are valid reaons for stripped down implementations, but > > can't think of too many. > > Clean separation of content and presentation? That is one strong > point (for some people anyway). Well, whether you write Hello , how are you? or Hello {{ USER }}, how are you? doesn't really matter I'd say. > Ease of use? I want to let *other people* customize the web page to > some extent, but surely do not want to require them to learn PHP. Also in this regard. -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) CPU not found. retry, abort, ignore? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] template solutions?
At 5/1/2001 03:05 AM, Dave Goodrich wrote: >>In PHP, if I have my database password in a global var $dbpass, >>I cannot prevent this code: >> >> eval('echo $dbpass'); >Never put your DBPass into a GLOBAL ;^) Hm, perhaps creating a function do_connect('hostname','user','pass') is safer? Good idea. >Agreed, it's not worth your time and hassle to try and predict >every possible circumstance a user might try. >Have you thought about some SSI and a few Javascripts? >depending on what you mean by "changing the look of a page" it might be easier. Mm. I still prefer a template, thank you :) >A stupid question but I gotta ask, have you looked through >freshmeat? lots of stuff like this done in Perl, Python, PHP. Yes, I have done a search on freshmeat and sourceforge for php templates. Btw, there are eazytemplates and php dreamtime that I've been told that supports ifs and loops. That's nice. Thanks to everybody who responded. Steve -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] template solutions?
I was not referring to "safe mode". In other languages like Perl or Python, "safe execution" means that if I execute some code (or eval a code string supplied by user), I can restrict what kinds of operation is valid for it, or what kinds of variables are available to it. In PHP, if I have my database password in a global var $dbpass, I cannot prevent this code: eval('echo $dbpass'); from printing my database password. Well of course you could do unset($dbpass) or even unset($GLOBALS) or save it to somewhere else... But still I cannot even prevent things like this: eval('echo 1/0'); from stopping my own program because it generates an error that I cannot trap. Well, actually there is error handlers... Perhaps you can get your way around to make eval() more secure, but still I prefer not to trust a code string from user to be eval()'ed by my PHP script. Just letting a user modify a template and changing the look of a page is sufficient for me, since that is all the user is supposed to gain access to. Regards, Steve At 5/1/2001 02:23 AM, Dave Goodrich wrote: >On Monday, April 30, 2001, at 12:02 PM, Steven Haryanto wrote: > >>Security? I do not want other people to have access to the PHP runtime >>(where they can do nasty things like stealing my database password, >>etc). PHP currently does not support any restricted execution of user >>code whatsoever. >in httpd.conf > > > DocumentRoot /usr/local/www/thisUser > ServerName thisUser.myServer.com > php_value include_path /usr/local/www/thisUser/inc > php_value open_basedir /usr/local/www/thisUser > > >You could do a lot to control your users abilities/privleges in this way. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] template solutions?
On Monday, April 30, 2001, at 12:02 PM, Steven Haryanto wrote: > Security? I do not want other people to have access to the PHP runtime > (where they can do nasty things like stealing my database password, > etc). PHP currently does not support any restricted execution of user > code whatsoever. > in httpd.conf DocumentRoot /usr/local/www/thisUser ServerName thisUser.myServer.com php_value include_path /usr/local/www/thisUser/inc php_value open_basedir /usr/local/www/thisUser You could do a lot to control your users abilities/privleges in this way. Dave Goodrich Director of Interface Development Reality Based Learning Company 9521 NE Willows Road, Suite 100 Redmond, WA 98052 Toll Free 1-877-869-6603 ext. 237 Fax (425) 558-5655 [EMAIL PROTECTED] http://www.rblc.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] template solutions?
I'm using EasyTemplates from Web Application Development with PHP book by Tobias Ratschiller. It's quite simple, easy to modify, and I loop on a template, appending the html to a variable that I use elsewhere in another template. It really straightens out logic because you're building the pages bottom up, so to speak, and you know everything before you output any html. It came on the cd in the book. Not sure if it's on http://www.phpwizard.net/ or not. > -Original Message- > From: Steven Haryanto [mailto:[EMAIL PROTECTED]] > Sent: Sunday, April 29, 2001 7:55 AM > To: [EMAIL PROTECTED] > Subject: [PHP] template solutions? > Does anyone know a rather advanced template solution in PHP? > At least one that supports loop and if (like HTML::Template), > and directives/commands would be nice (like Perl's Template > Toolkit). > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] template solutions?
At 5/1/2001 01:43 AM, Fabian Raygosa wrote: >Maybe this is what you are looking for >http://www.thewebmasters.net/php/FastTemplate.phtml Nope. I was looking for a template that supports loops and IFs. Someone pointed me to php dreamtime: http://www.phptemplates.org/ which is a cool project, by the way. Btw, I think I might need some extra "tags" to my template "language" so I'm going to hack this on by myself at the time being. Thanks, Steve -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] template solutions?
At 5/1/2001 01:43 AM, Michael Kimsal wrote: >I understand completely what you're getting at already, but PHP is >designed to do what you're asking to do. > >I know there are valid reaons for stripped down implementations, but can't >think of too many. Clean separation of content and presentation? That is one strong point (for some people anyway). Ease of use? I want to let *other people* customize the web page to some extent, but surely do not want to require them to learn PHP. Security? I do not want other people to have access to the PHP runtime (where they can do nasty things like stealing my database password, etc). PHP currently does not support any restricted execution of user code whatsoever. For some applications, sometime I don't even want people to *know* that I am using PHP. >And actually, I would consider RTF or PDF to be >languages unto themselves. There's a full syntax to use to get specific >results, and if you're throwing conditionals in there, or variables, it's >hard to see how it's not a language. Maybe not full-featured, but a >language nonetheless. I agree. But you said earlier, "programming language". Programming languages are used to create *programs*. These perhaps can be loosely called "document languages". -- sh -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] template solutions?
Maybe this is what you are looking for http://www.thewebmasters.net/php/FastTemplate.phtml - Original Message - From: "Steven Haryanto" <[EMAIL PROTECTED]> To: "Michael Kimsal" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Monday, April 30, 2001 11:40 AM Subject: Re: [PHP] template solutions? > See the philosophy behind HTML::Template for explanation on this: > > http://www.perlmonth.com/features/template/template.html?issue=11 > > Not everything with loops and IFs is a programming language. I would > probably call PDF or RTF a programming language too if it were. > > Steve > > > At 5/1/2001 01:10 AM, Michael Kimsal wrote: > >No, you're asking for something with loops and IFs. That's a programming > >language. > > > > > >On Tue, 1 May 2001, Steven Haryanto wrote: > > > > > Actually, not using a programming language is the point of template, > > > since I do not want to expose anything other than some template > > > 'variables' to the template. > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] template solutions?
I understand completely what you're getting at already, but PHP is designed to do what you're asking to do. I know there are valid reaons for stripped down implementations, but can't think of too many. And actually, I would consider RTF or PDF to be languages unto themselves. There's a full syntax to use to get specific results, and if you're throwing conditionals in there, or variables, it's hard to see how it's not a language. Maybe not full-featured, but a language nonetheless. On Tue, 1 May 2001, Steven Haryanto wrote: > See the philosophy behind HTML::Template for explanation on this: > > http://www.perlmonth.com/features/template/template.html?issue=11 > > Not everything with loops and IFs is a programming language. I would > probably call PDF or RTF a programming language too if it were. > > Steve > > > At 5/1/2001 01:10 AM, Michael Kimsal wrote: > >No, you're asking for something with loops and IFs. That's a programming > >language. > > > > > >On Tue, 1 May 2001, Steven Haryanto wrote: > > > > > Actually, not using a programming language is the point of template, > > > since I do not want to expose anything other than some template > > > 'variables' to the template. > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] template solutions?
See the philosophy behind HTML::Template for explanation on this: http://www.perlmonth.com/features/template/template.html?issue=11 Not everything with loops and IFs is a programming language. I would probably call PDF or RTF a programming language too if it were. Steve At 5/1/2001 01:10 AM, Michael Kimsal wrote: >No, you're asking for something with loops and IFs. That's a programming >language. > > >On Tue, 1 May 2001, Steven Haryanto wrote: > > > Actually, not using a programming language is the point of template, > > since I do not want to expose anything other than some template > > 'variables' to the template. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] template solutions?
No, you're asking for something with loops and IFs. That's a programming language. On Tue, 1 May 2001, Steven Haryanto wrote: > Actually, not using a programming language is the point of template, > since I do not want to expose anything other than some template > 'variables' to the template. > > Steve > > At 5/1/2001 12:36 AM, Michael Kimsal wrote: > >Why not just use PHP in the template? That's kinda what it was made for. > > > >On Sun, 29 Apr 2001, Steven Haryanto wrote: > > > > > Does anyone know a rather advanced template solution in PHP? > > > At least one that supports loop and if (like HTML::Template), > > > and directives/commands would be nice (like Perl's Template > > > Toolkit). > > > > > > I am currently rolling my own, but still not happy with the > > > result of the design. I'd be happy to use one that is already > > > out there. > > > > > > Steve > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] template solutions?
Actually, not using a programming language is the point of template, since I do not want to expose anything other than some template 'variables' to the template. Steve At 5/1/2001 12:36 AM, Michael Kimsal wrote: >Why not just use PHP in the template? That's kinda what it was made for. > >On Sun, 29 Apr 2001, Steven Haryanto wrote: > > > Does anyone know a rather advanced template solution in PHP? > > At least one that supports loop and if (like HTML::Template), > > and directives/commands would be nice (like Perl's Template > > Toolkit). > > > > I am currently rolling my own, but still not happy with the > > result of the design. I'd be happy to use one that is already > > out there. > > > > Steve -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] template solutions?
Why not just use PHP in the template? That's kinda what it was made for. On Sun, 29 Apr 2001, Steven Haryanto wrote: > Does anyone know a rather advanced template solution in PHP? > At least one that supports loop and if (like HTML::Template), > and directives/commands would be nice (like Perl's Template > Toolkit). > > I am currently rolling my own, but still not happy with the > result of the design. I'd be happy to use one that is already > out there. > > Steve -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]