Forum for any topic of interest to the Qcodo community, including questions about the framework itself.
Hi I was wondering if there is a simple way to use a string as the template of a QPanel instead of specifying a file. I have a QPanel that needs to render several different possible templates, these are somewhat dynamic and change based on the user logged in etc.
Hello banetbi!
Use that string as the panel Text property value and set HtmlEntities to false.
Note: The string rendered “as is” and not evaluated.
Regards, Attila
I suggest doing a lot. Tpl.php for each case
example
if (x) $ this-> pnl-> Template = “another1.tpl.php”; else if (y) $ this-> pnl-> Template = “another2.tpl.php”; else $ this-> pnl-> Template = “another3.tpl.php”;
Thanks for the info guys, I ended up using the dynamic template and it works great.
Thanks