|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
CapCa Smarty n00b
Joined: 20 Feb 2013 Posts: 2
|
Posted: Wed Feb 20, 2013 3:34 pm Post subject: include_php erkennt nicht Smarty Klasse (Variable: $this) |
|
|
Hey Leute,
in der Dokumentation von Smarty steht:
Quote: | Das Objekt '$smarty' kann in dem eingebundenen PHP-Script über '$this' angesprochen werden. |
Jedoch, wenn ich in der eingebundenen Datei die Variable $this abrufe zeigt es mir nur auf, dass die Variable nicht vorhanden ist:
Code: | Undefined variable: this in ... |
Habe ich irgendetwas übersehen?
Code Smarty:
Code: |
<h1>{$title}</h1>
{include_php file="file.php"}
|
Code PHP-Datei file.php:
Code: |
<?php
var_dump($this);
?>
|
Danke
CapCa
PS: Meine Smarty-Version: 3.1.13 |
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Wed Feb 20, 2013 8:16 pm Post subject: |
|
|
Hier wurde scheinbar die Doku nicht an Smarty 3 angepasst.
Versuche mal
Code: | <?php
var_dump($_smarty_tpl->smarty);
?> |
|
|
Back to top |
|
CapCa Smarty n00b
Joined: 20 Feb 2013 Posts: 2
|
Posted: Fri Feb 22, 2013 8:57 am Post subject: |
|
|
Hat gestimmt, danke |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|