2024-06-20 12:04:05
2024-06-19 02:28:02
2024-06-19 02:28:02
44716779
!Friendica Developers
Hey guys, is there something special I need to know about using smarty? I'm back to plugging away on the quiz option, trying to make a dynamic radio button that is clickable and returns a value. I have a version using a js file, that works with an HTML document, but I'm having issues integrating it into tpl files with php variables.
html_radios is a smarty option we have that should create dynamic radio buttons. Problem is I can't make it work even though I'm using this https://www.smarty.net/docsv2/en/language.function.html.radios.tpl Which is a copy of a md file we have.
I will put something like:
Into the content/question.tpl file
If I run it as normal, it just spits out code as a result in the poll.
If I run something like this in /model/item.php
I want to make sure there isn't some easy fix that I need to do to smarty to make it work right, it might well be I'm just doing it all wrong with my non-professional newb status. If there isn't I'll just keep pluging and chugging til i figure it out. Just went to make sure I'm not wasting my time where there is any easy fix. I have tried various mutations of this and it always just gives me white screen.
Hey guys, is there something special I need to know about using smarty? I'm back to plugging away on the quiz option, trying to make a dynamic radio button that is clickable and returns a value. I have a version using a js file, that works with an HTML document, but I'm having issues integrating it into tpl files with php variables.
html_radios is a smarty option we have that should create dynamic radio buttons. Problem is I can't make it work even though I'm using this https://www.smarty.net/docsv2/en/language.function.html.radios.tpl Which is a copy of a md file we have.
I will put something like:
{html_radios options=$options.name
separator='<br />'}
Into the content/question.tpl file
If I run it as normal, it just spits out code as a result in the poll.
If I run something like this in /model/item.php
$smarty->assign('options_title', $option.name));
{html_radios options=$options_title
separator='<br />'}
It always gives me just a white screen.I want to make sure there isn't some easy fix that I need to do to smarty to make it work right, it might well be I'm just doing it all wrong with my non-professional newb status. If there isn't I'll just keep pluging and chugging til i figure it out. Just went to make sure I'm not wasting my time where there is any easy fix. I have tried various mutations of this and it always just gives me white screen.
Friendica Developers reshared this.
Michael Vogel
in reply to anubis2814 • • •anubis2814
in reply to Michael Vogel • •Friendica Developers reshared this.
anubis2814
in reply to anubis2814 • •The exception it threw now is for $smarty array being undefined. Do i need to "use" a file to make it work?
Friendica Developers reshared this.
anubis2814
in reply to anubis2814 • •Now it throws a white screen but nothing shows up in the error log.
Friendica Developers reshared this.