Re[2]: [SMARTY-DEV] Var Templates

From: Date: Wed, 16 Apr 2003 09:48:24 +0000
Subject: Re[2]: [SMARTY-DEV] Var Templates
References: 1 2 3  Groups: php.smarty.dev 
Request: Send a blank email to php-smarty-dev+get-1185@lists.php.net to get a copy of this message
Wb> You DONT let PHP create URLs, this is done in the template Are you sure ? In a web application, an URL is a little like a procedure address, and it's part of logic, not part of presentation. By URL i think about the href part, not the full link of course. In my opinion <a href="blah.php?id={$ID}&var1={$FOO.var1}&var..."> is not a good idea in the template. <a href="{$THEURL}"> is good; and you can use the link in a javascript, with a button or anything else. But it should be formatted within the PHP code. Wb> The magic rule is not to have ANY html, not even something Wb> like "left|center|right" to pass to an align atribute, in Wb> PHP. Same rule for ANY messages (yes, the E-Mails sent by Wb> your application should be created with templates, too) etc. Wb> A good way to seperate cleanly is always to bear in mind that Wb> it should be possible to create the same website with a Wb> COMPLETELY different layout (not only colors and graphics, Wb> but also positioning of elements etc) without needing to Wb> change even ONE single line of PHP code. THAT'S the purpose Wb> of Smarty. +100% :) In my opinion, Smarty requires to work with a different logic in mind. I think that the "Why use Smarty" article written by Monte explains correctly why and how smarty should be used. Katana

« previous php.smarty.dev (#1185) next »