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

Smarty unter Verwendung von Namespaces

 
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
eazytrader
Smarty Rookie


Joined: 16 Jul 2010
Posts: 33

PostPosted: Wed May 23, 2012 7:19 pm    Post subject: Smarty unter Verwendung von Namespaces Reply with quote

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
View user's profile Send private message
rodneyrehm
Administrator


Joined: 30 Mar 2007
Posts: 674
Location: Germany, border to Switzerland

PostPosted: Wed May 23, 2012 8:22 pm    Post subject: Reply with quote

Code:
$foo = new \Smarty();


Wink
_________________
Twitter
Back to top
View user's profile Send private message Visit poster's website
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