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

Problems with register_modifier or alike!

 
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 -> Bugs
View previous topic :: View next topic  
Author Message
prec
Smarty n00b


Joined: 08 Sep 2003
Posts: 2

PostPosted: Mon Sep 08, 2003 12:41 pm    Post subject: Problems with register_modifier or alike! Reply with quote

As i see it, the following code should work:

Code:

<?php

class test
{
   function test2() {
      echo "test";
   }
}
$test = new test;

require_once("lib/Smarty.class.php");
$Smarty = new Smarty;

$Smarty->register_function("test", array(&$test, "test2"));

$Smarty->display("test.tpl");

?>


but it returns:
Fatal error: Smarty error: [in test.tpl line 1]: [plugin] function 'test' is not implemented (Smarty.class.php, line 2462) in D:\wwwroot\goldenarrow\lib\Smarty.class.php on line 2652

Is this a bug, or me?
Back to top
View user's profile Send private message
messju
Administrator


Joined: 16 Apr 2003
Posts: 3336
Location: Oldenburg, Germany

PostPosted: Mon Sep 08, 2003 12:43 pm    Post subject: Reply with quote

you need Smarty-2.6.0-RC1 for that.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
prec
Smarty n00b


Joined: 08 Sep 2003
Posts: 2

PostPosted: Mon Sep 08, 2003 12:50 pm    Post subject: Reply with quote

I updated to 2.6-RC1

now it returns:

Fatal error: Call to undefined function: _load_plugins() in D:\wwwroot\goldenarrow\templates_c\%%183\%%1836865061\test.tpl.php on line 3
Back to top
View user's profile Send private message
messju
Administrator


Joined: 16 Apr 2003
Posts: 3336
Location: Oldenburg, Germany

PostPosted: Mon Sep 08, 2003 12:51 pm    Post subject: Reply with quote

you have to wipe out everything in "templates_c/" and in "cache/" after upgrading.
Back to top
View user's profile Send private message Send e-mail 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 -> Bugs 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