问题
The vchart module installed in Joomla, allows you to create charts with your own sql query. It even suggests by example that you can add a custom variable in the query, stating:
You can also include dynamic variables in your SQL query. You just need to enter variable name within curly braces. e.g.
{catid}.{loggedinuserid}is reserverd for Logged-in User
So I assume I would need to create a php variable $username for example and if this is in page where I embedded the chart it should get picked up by {username} in sql query?
However seems that php code embedded by custompage builder just shows as text
<pre class="language-php"><code>echo 'hi';</code></pre>
prints out
echo 'hi';
and doesn't execute php. Has anyone got an ideas on how to make the php variable available?
来源:https://stackoverflow.com/questions/58121940/variables-added-to-vchart-joomla-sql-query-not-picked-up