Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

include_php erkennt nicht Smarty Klasse (Variable: $this)

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Language: German
View previous topic :: View next topic  
Author Message
CapCa
Smarty n00b


Joined: 20 Feb 2013
Posts: 2

PostPosted: Wed Feb 20, 2013 3:34 pm    Post subject: include_php erkennt nicht Smarty Klasse (Variable: $this) Reply with quote

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 Smile

CapCa

PS: Meine Smarty-Version: 3.1.13
Back to top
View user's profile Send private message
U.Tews
Administrator


Joined: 22 Nov 2006
Posts: 5068
Location: Hamburg / Germany

PostPosted: Wed Feb 20, 2013 8:16 pm    Post subject: Reply with quote

Hier wurde scheinbar die Doku nicht an Smarty 3 angepasst.

Versuche mal
Code:
<?php
var_dump($_smarty_tpl->smarty);
?>
Back to top
View user's profile Send private message
CapCa
Smarty n00b


Joined: 20 Feb 2013
Posts: 2

PostPosted: Fri Feb 22, 2013 8:57 am    Post subject: Reply with quote

Hat gestimmt, danke Smile
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Language: German All times are GMT
Page 1 of 1

 
Jump to:  
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
Protected by Anti-Spam ACP