<?xml version='1.0' encoding='UTF-8'?>
<rss version='2.0'>
	<channel>
		<title>cotonti.com : PHP code in .tpl</title>
		<link>https://www.cotonti.com</link>
		<description>Neueste Themenbeiträge</description>
		<generator>Cotonti</generator>
		<language>en</language>
		<pubDate>Mon, 04 May 2026 16:25:56 -0000</pubDate>

		<item>
			<title>Trustmaster</title>
			<description><![CDATA[<p>
	There is no way to include PHP files from a template and there will not be for security reasons. If you need a way to include the output of a PHP script in your template, then you should create a plugin that would wrap that PHP script and assign TPL tags, or at least assign its output to some global variable. You can place the PHP code directly into 'themes/your_theme/your_theme.php' file but still it must assign the HTML output to a global variable rather than echoing it.</p>
]]></description>
			<pubDate>Fr, 27 Jul 2012 19:45:37 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/de/forums?m=posts&q=7020&d=0#post35027]]></link>
		</item>
		<item>
			<title>duck101</title>
			<description><![CDATA[<p>
	Sorry for my ignorance on callback functions, but how do I tell it where to find my php file. is the code below right?</p>
<p>
	{PHP.somevariable|my_function('form.php')}</p>
<p>
	 </p>
]]></description>
			<pubDate>Fr, 27 Jul 2012 18:52:36 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/de/forums?m=posts&q=7020&d=0#post35026]]></link>
		</item>
		<item>
			<title>GHengeveld</title>
			<description><![CDATA[<p>
	The only way to execute php code directly from a template file is to use a callback function. You can call any php function from your tpl, both built-in and custom functions. The return value will be displayed in the HTML, which means the callback should return a string or a number, or nothing at all. You can use a callback function like this:</p>
<pre class="brush:java;">
{PHP|my_function('param1', 'param2')}</pre>
<p>
	Alternatively, you can combine it with a template tag or php variable:</p>
<pre class="brush:java;">
{MYTAG|my_function()}

{PHP.somevariable|my_function()}</pre>
<p>
	More info: http://www.cotonti.com/docs/ext/themes/cotemplate_advanced</p>
]]></description>
			<pubDate>Fr, 27 Jul 2012 17:14:20 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/de/forums?m=posts&q=7020&d=0#post35025]]></link>
		</item>
		<item>
			<title>duck101</title>
			<description><![CDATA[<p>
	Hello, I tried to insert a php code into a tpl file, and for some reason not all of the code would display right. I've heard that php in tpl files is a big no,no. I then tried another option-- &lt;script src=https://www.cotonti.com/<span class="string">"form.php"</span>&gt;&lt;/script&gt; to no avail.  Is there another way to call up a php file from a tpl file?</p>
]]></description>
			<pubDate>Fr, 27 Jul 2012 16:55:47 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/de/forums?m=posts&q=7020&d=0#post35024]]></link>
		</item>
	</channel>
</rss>