Re: [SMARTY] generating php

From: Date: Mon, 10 Jun 2002 07:29:57 +0000
Subject: Re: [SMARTY] generating php
References: 1 2 3 4 5  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-4718@lists.php.net to get a copy of this message
Yes, that makes sense as far as it goes. But I don't care about installation efficiency. So what if it's a million times slower? You only do it once. I should add that this isn't a big technical issue. I can use str_replace, or preg_replace or whatever. The "issue", a word that makes it sound bigger than it is, is that I'd like the application installer to use the same mechanism for all generated files. I find that a cleaner approach. If the application itself requires Smarty, why not require it for installation as well? Anyway, I re-invented primitive templating to generate PHP, and I used Smarty (or plain copy) for everything else. So no biggie. cheers, Travis Let me put it this way. I'm writing Ivo Jansch wrote:
Hi, Travis Low wrote:
doing MORE than just replacing strings in a file. For example, I could ask the user if they wanted to disable this or enable that, and it would be handled with Smarty if statements that would emit this or that PHP code. Make sense?
So you want to be able to do something like this: install("myapp", {$mypath}); I see no sense whatsoever for doing this in Smarty. You would have to: 1) assign the variable to smarty 2) parse the php file through Smarty 3) run the parsed php code Why not do: install("myapp", $config_path); or something like this? Since you can't get around step 1 in the above example, SOMEWHERE you have to assign the value to a variable. Might as well directly be $config_path then. And php if statements are less overhead than smarty if statements. (Because of the compilation step) Greetings, Ivo
-- Travis Low <mailto:travis@dawnstar.org> <http://dawnstar.org/travis>

« previous php.smarty.general (#4718) next »