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

Difficulties in loading personal plugin...

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


Joined: 09 Oct 2004
Posts: 3

PostPosted: Sat Oct 09, 2004 5:05 pm    Post subject: Difficulties in loading personal plugin... Reply with quote

Hi to you all...

I'm a new user of Smarty and I tried developping a plugin (function)...

I followed the naming rules and placed the file in my plugins direct ory...

However, when I call this plugin in a template, it doesn't work ! The name of the plugin appears instead of the result...

I developped a modifier plugin and this one works...

Strange...

Can anyone help me ?

THX
Back to top
View user's profile Send private message Visit poster's website
boots
Administrator


Joined: 16 Apr 2003
Posts: 5611
Location: Toronto, Canada

PostPosted: Sat Oct 09, 2004 6:02 pm    Post subject: Reply with quote

sure -- just post some actual details
Back to top
View user's profile Send private message
kills
Smarty Elite


Joined: 28 May 2004
Posts: 493

PostPosted: Sat Oct 09, 2004 6:46 pm    Post subject: Reply with quote

boots wrote:
sure -- just post some actual details


e.g. your code? Smile
Back to top
View user's profile Send private message
adzero
Smarty n00b


Joined: 09 Oct 2004
Posts: 3

PostPosted: Sun Oct 10, 2004 8:13 am    Post subject: Solution found... Reply with quote

After some tests I found the solution to my problem...and by the same time I think I've found a bug in smarty...

Here it is !

The function plugin I was trying to create was a derivate version of html_table...

So I copied the file smarty.function.html_table.php to smarty.function.html_tablev2.php. Then I changed the name of the function inside my new file to smarty_html_tablev2.

At template execution the only thing I can see is html_tablev2...instead of the table.

Then I had the idea of changing names to something like"test". The new file name was smarty.function.test.php and the corresponding function test.php.

With this name, It works, I obtain the table just as with html_table function.

Later I found that if two plugins have names that begin with the same string (e.g. html_table and html_tablev2), the function with the longest name cannot be used...

Seems like a bug... Need more testing to be sure...
Back to top
View user's profile Send private message Visit poster's website
adzero
Smarty n00b


Joined: 09 Oct 2004
Posts: 3

PostPosted: Sun Oct 10, 2004 8:22 am    Post subject: It's really a bug Reply with quote

Found a post about this in the Bug section.

http://www.phpinsider.com/smarty-forum/viewtopic.php?t=2940

Seems o be (re) new with 2.6.5 version.
Back to top
View user's profile Send private message Visit poster's website
messju
Administrator


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

PostPosted: Sun Oct 10, 2004 12:43 pm    Post subject: Re: It's really a bug Reply with quote

adzero wrote:
Seems o be (re) new with 2.6.5 version.


yes. and fixed in cvs quite some time ago.
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 -> Plugins 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