2004-04-13 08:46:28 +00:00
|
|
|
|
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
|
|
|
|
<!-- $Revision$ -->
|
2005-12-09 19:50:41 +00:00
|
|
|
|
<!-- EN-Revision: 1.7 Maintainer: andreas Status: ready -->
|
2005-06-24 09:02:38 +00:00
|
|
|
|
<sect1 id="language.function.php">
|
|
|
|
|
|
<title>php</title>
|
|
|
|
|
|
<para>
|
|
|
|
|
|
{php}-Tags erlauben es, PHP-Code direkt in das Template
|
|
|
|
|
|
einzubetten. Der Inhalt wird nicht 'escaped', egal wie <link
|
|
|
|
|
|
linkend="variable.php.handling">$php_handling</link> konfiguriert
|
|
|
|
|
|
ist. Dieses Tag ist nur f<>r erfahrene Benutzer gedacht und wird
|
|
|
|
|
|
auch von diesen normalerweise nicht ben<65>tigt.
|
|
|
|
|
|
</para>
|
|
|
|
|
|
<example>
|
|
|
|
|
|
<title>{php}-Tags</title>
|
|
|
|
|
|
<programlisting>
|
|
|
|
|
|
<![CDATA[
|
2004-04-13 08:46:28 +00:00
|
|
|
|
{php}
|
2005-06-24 09:02:38 +00:00
|
|
|
|
// php Skript direkt von Template einbinden
|
2005-12-09 19:50:41 +00:00
|
|
|
|
include('/pfad/zu/zeige_weather.php');
|
2005-06-24 09:02:38 +00:00
|
|
|
|
{/php}
|
|
|
|
|
|
]]>
|
|
|
|
|
|
</programlisting>
|
|
|
|
|
|
</example>
|
|
|
|
|
|
<note>
|
|
|
|
|
|
<title>Technical Note</title>
|
|
|
|
|
|
<para>
|
|
|
|
|
|
Um auf PHP-Variablen in {php}-Bl<42>cken zugreifen zu k<>nnen, kann es
|
|
|
|
|
|
n<>tig sein, die Variable als <ulink
|
|
|
|
|
|
url="&url.php-manual;global">global</ulink> zu deklarieren. Der
|
|
|
|
|
|
{php}-Bl<42>ck l<>uft n<>mlich nicht in einem globalen Kontext, sondern
|
|
|
|
|
|
im Kontext der method des laufenden $smarty-Objektes.
|
|
|
|
|
|
</para>
|
|
|
|
|
|
</note>
|
2005-12-09 19:50:41 +00:00
|
|
|
|
<example>
|
|
|
|
|
|
<title>{php} mit Verwendung von global</title>
|
|
|
|
|
|
<programlisting role="php">
|
|
|
|
|
|
<![CDATA[
|
|
|
|
|
|
{php}
|
|
|
|
|
|
global $foo, $bar;
|
|
|
|
|
|
if($foo == $bar){
|
|
|
|
|
|
// tue irgendwas
|
|
|
|
|
|
}
|
|
|
|
|
|
{/php}
|
|
|
|
|
|
]]>
|
|
|
|
|
|
</programlisting>
|
|
|
|
|
|
</example>
|
2005-06-24 09:02:38 +00:00
|
|
|
|
<para>
|
|
|
|
|
|
Siehe auch <link
|
|
|
|
|
|
linkend="variable.php.handling">$php_handling</link>, <link
|
|
|
|
|
|
linkend="language.function.include.php">{include_php}</link>, <link
|
|
|
|
|
|
linkend="language.function.include">{include}</link> und <link
|
|
|
|
|
|
linkend="tips.componentized.templates">Template/Script
|
|
|
|
|
|
Komponenten</link>.
|
|
|
|
|
|
</para>
|
2004-04-13 08:46:28 +00:00
|
|
|
|
</sect1>
|
|
|
|
|
|
<!-- Keep this comment at the end of the file
|
|
|
|
|
|
Local variables:
|
|
|
|
|
|
mode: sgml
|
|
|
|
|
|
sgml-omittag:t
|
|
|
|
|
|
sgml-shorttag:t
|
|
|
|
|
|
sgml-minimize-attributes:nil
|
|
|
|
|
|
sgml-always-quote-attributes:t
|
|
|
|
|
|
sgml-indent-step:1
|
|
|
|
|
|
sgml-indent-data:t
|
|
|
|
|
|
indent-tabs-mode:nil
|
|
|
|
|
|
sgml-parent-document:nil
|
|
|
|
|
|
sgml-default-dtd-file:"../../../../manual.ced"
|
|
|
|
|
|
sgml-exposed-tags:nil
|
|
|
|
|
|
sgml-local-catalogs:nil
|
|
|
|
|
|
sgml-local-ecat-files:nil
|
|
|
|
|
|
End:
|
|
|
|
|
|
vim600: syn=xml fen fdm=syntax fdl=2 si
|
|
|
|
|
|
vim: et tw=78 syn=sgml
|
|
|
|
|
|
vi: ts=1 sw=1
|
2004-07-16 14:32:31 +00:00
|
|
|
|
-->
|