[thelist] PHP / smarty
David Miller
david at deadpansincerity.com
Sun Oct 9 12:05:40 CDT 2011
>
> The question. How can you convert the smarty ID to a PHP variable that can
> be used in the PHP/MySQL query?
Something like:
{php}
$prod = $this->getTemplateVars('product');
$prod_id = $prod->id
do_some_database_query($prod_id);
{/php}
?
Don't do this :)
Instead rip out the pointless and redundant Php Template Engine.
If you can't do that, then unless it's deeply insane, the smarty object is
getting instantiated and passed existing PHP variables.
Do your database logic there & pass in whatever objects you get back.
--
Love regards etc
David Miller
http://www.deadpansincerity.com
07854 880 883
More information about the thelist
mailing list