Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.

SmartyML for Smarty 3

 
Post new topic   Reply to topic    Smarty Forum Index -> Smarty 3
View previous topic :: View next topic  
Author Message
imp4ct
Smarty n00b


Joined: 14 Nov 2009
Posts: 3

PostPosted: Sat Nov 14, 2009 2:31 pm    Post subject: SmartyML for Smarty 3 Reply with quote

Hi,

I'm really happy that Smarty 3 is almost finished but I have a question.
I'm now using SmartyML.class since I need to work with languages files. SmartyML.class is an extention on the normal Smarty 2 class.

But now with Smarty 3 I'm quite sure this extention won't work anymore. Therefor I was wondering if it would be possible to maybe implement this fucntion into Smarty 3, because it's actually very usefull.

Or, if it's not possible to add it to Smarty 3, I'm hoping that it still will be possible to extend the Smarty3.class and make some sort of Smarty3ML.class.

Thanks!
Back to top
View user's profile Send private message
U.Tews
Administrator


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

PostPosted: Sat Nov 14, 2009 3:02 pm    Post subject: Reply with quote

If you extend the SMarty3 class you must use PHP5 style __construct functions.

Replace
Code:
    function smartyML ($locale="") {
      $this->Smarty();

      // Multilanguage Support
      // use $smarty->language->setLocale() to change the language of your template
      //     $smarty->loadTranslationTable() to load custom translation tables
      $this->language = new ngLanguage($locale); // create a new language object
      $GLOBALS['_NG_LANGUAGE_'] =& $this->language;
      $this->register_prefilter("smarty_prefilter_i18n");
    }


with
Code:
    function __construct ($locale="") {
      parent::__construct();

      // Multilanguage Support
      // use $smarty->language->setLocale() to change the language of your template
      //     $smarty->loadTranslationTable() to load custom translation tables
      $this->language = new ngLanguage($locale); // create a new language object
      $GLOBALS['_NG_LANGUAGE_'] =& $this->language;
      $this->register_prefilter("smarty_prefilter_i18n");
    }


I have not tested it myself. So any feedback is wellcome.
Back to top
View user's profile Send private message
imp4ct
Smarty n00b


Joined: 14 Nov 2009
Posts: 3

PostPosted: Sat Nov 14, 2009 6:44 pm    Post subject: Reply with quote

I'll try it as soon as possible!
Thanks!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Smarty Forum Index -> Smarty 3 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