|
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 |
eazytrader Smarty Rookie
Joined: 16 Jul 2010 Posts: 33
|
Posted: Wed May 23, 2012 7:19 pm Post subject: Smarty unter Verwendung von Namespaces |
|
|
Hallo Leute,
ich habe ein kleines Problem.
Ich bekomme es nicht hin, in meiner Klasse ein Smarty Objekt zu erzeugen. Da ich Namespaces verwende, kann die Klasse nicht gefunden werden. Hat jemand eine Idee, wie man das trotz Namespaces Lösen kann?
Code: | Namespace Core\Controllers;
use Core\Models\Test as Test;
class Controller{
public $name;
public $test;
public $smarty;
public function __construct(){
// Das Funktioniert
$this->test = new Test();
include_once('Core/External/Smarty/libs/Smarty.class.php')
// Das Funktioniert nicht!
// Fehler Core\Controllers\Smarty kann nicht gefunden werden.
$this->smarty = new Smarty();
}
public function register($module){
}
} |
|
|
Back to top |
|
rodneyrehm Administrator
Joined: 30 Mar 2007 Posts: 674 Location: Germany, border to Switzerland
|
Posted: Wed May 23, 2012 8:22 pm Post subject: |
|
|
Code: | $foo = new \Smarty(); |
_________________ Twitter |
|
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
|