|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
rayj00 Smarty n00b
Joined: 15 Apr 2018 Posts: 3
|
Posted: Fri Nov 26, 2021 6:38 pm Post subject: Can I include javascript in a .tpl? |
|
|
So I am trying to implement a webrtc streaming feature in a social website application that uses PHP/Smarty. The webrtc feature runs on node and JavaScript. As I am fairly new to PHP and Smarty, I have concluded that the .tpl files are the files that actually show the website. My problem is getting some javascript to execute via the .tpl file.
Can this be done of am I barking up the wrong tree? I did do a search and pretty much came up empty.
Thanks for your help.
Ray |
|
Back to top |
|
rayj00 Smarty n00b
Joined: 15 Apr 2018 Posts: 3
|
Posted: Tue Nov 30, 2021 3:40 pm Post subject: no replies? |
|
|
Really? 62 views and no one can answer? |
|
Back to top |
|
AnrDaemon Administrator
Joined: 03 Dec 2012 Posts: 1785
|
Posted: Tue Nov 30, 2021 6:26 pm Post subject: |
|
|
Yes, this can be done. To Smarty(PHP), your TPL files are merely a byte stream. They take on HTML, JS or CSS (or any other) meaning only when viewed in the browser, long since Smarty finished its work. So, yes, you could embed literally any content in your TPL files. Even purely binary content, I did that before.
Quote: | Really? 62 views and no one can answer? |
Bots are not known for being good talkers. |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|