jaikar Posted July 1, 2009 Share Posted July 1, 2009 can we write php code in a .tpl file.. if yes how ?... thanks ! Quote 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. Quote 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} Quote 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. Quote 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 !.. Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.