# Controller .php Datei in .tpl einfügen

**URL:** <https://forum.shopware.com/t/controller-php-datei-in-tpl-einfugen/44823>\
**Category:** Programmierung\
**Created:** [27. März 2017 um 17:03 UTC](https://forum.shopware.com/t/controller-php-datei-in-tpl-einfugen/44823 "2017-03-27T17:03:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![maxkon](https://avatars.discourse-cdn.com/v4/letter/m/97f17d/32.png) [@maxkon](https://forum.shopware.com/u/maxkon)\
**Post date:** [27. März 2017 um 17:03 UTC](https://forum.shopware.com/t/controller-php-datei-in-tpl-einfugen/44823/1 "2017-03-27T17:03:26Z")

</div>

Hallo Community,

Ich benötige mal wieder die Hilfe dieses Forums.

&nbsp;

Ich möchte aus dem&nbsp;engine/Shopware/Controllers/Frontend Directory eine .php-Datei in eine .tpl-Datei includen, die sich im themes/Frontend Verzeichnis befindet.

Bei {include file:…} und {include\_php file:…}&nbsp;bekomme ich allerdings immer einen 503 Error Report. Selbiges, wenn ich den PHP Code in zwei {php} //Code {/php} Tags einbette innerhalb der .tpl-Datei.

Was mache ich denn falsch oder gehe ich die ganze Sache komplett falsch an?

&nbsp;

Danke im Vorraus,

Max K.

&nbsp;

P.S.: Ich muss das tun, um der .tpl-Datei anzuzeigen, woher diese die Werte für die Variablen hernehmen soll.

---

<div class="post-metadata">

**Author:** ![EikeBrandtWarneke](https://avatars.discourse-cdn.com/v4/letter/e/cdc98d/32.png) [@EikeBrandtWarneke](https://forum.shopware.com/u/EikeBrandtWarneke)\
**Post date:** [27. März 2017 um 17:20 UTC](https://forum.shopware.com/t/controller-php-datei-in-tpl-einfugen/44823/2 "2017-03-27T17:20:59Z")

</div>

PHP innerhalb von Smarty templates wurde mit Smarty 3 abgeschaff:&nbsp;[http://www.smarty.net/docs/en/language.function.php.tpl](http://www.smarty.net/docs/en/language.function.php.tpl)  
Siehe dazu auch diese Hinweise:&nbsp;[http://www.smarty.net/best\_practices](http://www.smarty.net/best_practices)

Hier solltest du dein Konzept noch einmal überdenken.

Viele Grüße

---

<div class="post-metadata">

**Author:** ![maxkon](https://avatars.discourse-cdn.com/v4/letter/m/97f17d/32.png) [@maxkon](https://forum.shopware.com/u/maxkon)\
**Post date:** [27. März 2017 um 17:43 UTC](https://forum.shopware.com/t/controller-php-datei-in-tpl-einfugen/44823/3 "2017-03-27T17:43:28Z")

</div>

> [@Aquatuning GmbH schrieb:](https://forum.shopware.com/profile/11752/Aquatuning%20GmbH "Aquatuning%20GmbH")
> 
> PHP innerhalb von Smarty templates wurde mit Smarty 3 abgeschaff:&nbsp;[http://www.smarty.net/docs/en/language.function.php.tpl](http://www.smarty.net/docs/en/language.function.php.tpl)  
> Siehe dazu auch diese Hinweise:&nbsp;[http://www.smarty.net/best\_practices](http://www.smarty.net/best_practices)
> 
> Hier solltest du dein Konzept noch einmal überdenken.
> 
> Viele Grüße

Ich hatte schon befürchtet, dass das nicht funktioniert, allerdings tu ich mir schwer anhand des Best Practice ein Plugin für meine Bedürfnisse zu konstruieren. Da es im Beispiel darum geht einen string zu bekommen und ich möchte lediglich dem .tpl einen Hinweis geben, wo er Values für die Variablen abrufen kann…&nbsp;
