servetas Posted January 17, 2016 Share Posted January 17, 2016 Hello, I am a programmer and I would like to give it a try and release a free module (as soon as I manage to develop it). I have read the documentation although I do have some questions which are not answered in it. I have created the module and this function: function module_output($vars) { echo 'Hello World!'; } I can echo whatever I want inside that function. My question is, how can I break it to a tpl file? When do I have to create it (in which directory) and what do i have to write in order to echo this template and pass variables to it. Thanks! PS: Looking forward to the Sample Addon Module Code 0 Quote Link to comment Share on other sites More sharing options...
servetas Posted January 18, 2016 Author Share Posted January 18, 2016 Anyone? 0 Quote Link to comment Share on other sites More sharing options...
servetas Posted January 20, 2016 Author Share Posted January 20, 2016 Has anyone came up with something like this in the past? I would be glad to know the solution of this. Thanks 0 Quote Link to comment Share on other sites More sharing options...
Kian Posted January 20, 2016 Share Posted January 20, 2016 Here's how. function MyAwesomeModule_output($vars) { $smarty->display(dirname(__FILE__) . '/theawesometemplateofmymodule.tpl'); } 0 Quote Link to comment Share on other sites More sharing options...
servetas Posted January 21, 2016 Author Share Posted January 21, 2016 Thank you very much. Is there any book in the market which would help me with smarty? 0 Quote Link to comment Share on other sites More sharing options...
Kian Posted January 21, 2016 Share Posted January 21, 2016 I don't really know but the official documentation is good enough. 0 Quote Link to comment 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.