Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.
Dedicated server web hosting provided by Guru-host.eu.
Smarty unter Verwendung von Namespaces

 
Post new topic   Reply to topic    Smarty Forum Index -> Language: German
View previous topic :: View next topic  
Author Message
eazytrader
Smarty Rookie


Joined: 16 Jul 2010
Posts: 31

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: 698
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:   
Post new topic   Reply to topic    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