jaikar Posted July 1, 2009 Share Posted July 1, 2009 can we write php code in a .tpl file.. if yes how ?... thanks ! Link to comment https://forums.phpfreaks.com/topic/164381-solved-smarty-can-we-write-a-php-code-in-a-tpl-file/ Share on other sites More sharing options...
Adam Posted July 1, 2009 Share Posted July 1, 2009 If you're using Smarty, why would you need to put PHP in a template file? Smarty has a lot of built-in functions, plus the ability to easily create your own. Link to comment https://forums.phpfreaks.com/topic/164381-solved-smarty-can-we-write-a-php-code-in-a-tpl-file/#findComment-867123 Share on other sites More sharing options...
syed Posted July 1, 2009 Share Posted July 1, 2009 yes you. {php} echo "Hello World"; {/php} Link to comment https://forums.phpfreaks.com/topic/164381-solved-smarty-can-we-write-a-php-code-in-a-tpl-file/#findComment-867181 Share on other sites More sharing options...
Adam Posted July 1, 2009 Share Posted July 1, 2009 What exactly do you plan to put in the {php} tags though? Take a look here. Link to comment https://forums.phpfreaks.com/topic/164381-solved-smarty-can-we-write-a-php-code-in-a-tpl-file/#findComment-867191 Share on other sites More sharing options...
jaikar Posted July 3, 2009 Author Share Posted July 3, 2009 you are right, i dont think i will have a situation to use php in .tpl. atleast i have not came to that situation yet. but still, i just wanted to know if there is a chance.. now i know how to use php in .tpl.. thankyou for your help.. really appreciated !.. Link to comment https://forums.phpfreaks.com/topic/164381-solved-smarty-can-we-write-a-php-code-in-a-tpl-file/#findComment-868513 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.