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

How to create a Smarty 3 compiler plugin?
Goto page Previous  1, 2, 3  Next
 
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 -> Smarty 3
View previous topic :: View next topic  
Author Message
caoimhin
Smarty Rookie


Joined: 08 Nov 2009
Posts: 24
Location: Lebbeke, Belgium

PostPosted: Thu Nov 12, 2009 9:04 pm    Post subject: Reply with quote

Ok, I can understand that. But why does that work with beta 1?

But yeah, I will create a function for it Smile Not my main goal, but better then nothing Smile
Back to top
View user's profile Send private message
U.Tews
Administrator


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

PostPosted: Thu Nov 12, 2009 9:11 pm    Post subject: Reply with quote

Nothing has has changed there. Are you sure that you did use it in child {block} sections before?
Back to top
View user's profile Send private message
caoimhin
Smarty Rookie


Joined: 08 Nov 2009
Posts: 24
Location: Lebbeke, Belgium

PostPosted: Thu Nov 12, 2009 9:16 pm    Post subject: Reply with quote

U.Tews wrote:
Nothing has has changed there. Are you sure that you did use it in child {block} sections before?


I wanted to say yes, but you're right. I call the template directly for testing purpose, I forgot that. Oops again Smile

But thnx for your help, I will try to create a function for this Smile
Back to top
View user's profile Send private message
U.Tews
Administrator


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

PostPosted: Thu Nov 12, 2009 9:21 pm    Post subject: Reply with quote

I'm just looking if the {block} compiler could be changed.

Hold the line for a moment....
Back to top
View user's profile Send private message
caoimhin
Smarty Rookie


Joined: 08 Nov 2009
Posts: 24
Location: Lebbeke, Belgium

PostPosted: Thu Nov 12, 2009 9:25 pm    Post subject: Reply with quote

Ow, thnx Smile

I know you think my approach is wrong, but I don't know any other way to calculate width and height just once and not on any page call.
Back to top
View user's profile Send private message
U.Tews
Administrator


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

PostPosted: Thu Nov 12, 2009 9:31 pm    Post subject: Reply with quote

The change in now in the SVN.

Please test.
Back to top
View user's profile Send private message
caoimhin
Smarty Rookie


Joined: 08 Nov 2009
Posts: 24
Location: Lebbeke, Belgium

PostPosted: Thu Nov 12, 2009 9:38 pm    Post subject: Reply with quote

Works just fine ! Thnx Smile
Back to top
View user's profile Send private message
caoimhin
Smarty Rookie


Joined: 08 Nov 2009
Posts: 24
Location: Lebbeke, Belgium

PostPosted: Thu Nov 12, 2009 9:45 pm    Post subject: Reply with quote

I just noticed something else .. Is it possible that the nocache does not work anymore on included files, or files that extend another file.

The same setup as for static_image, but with caching = 2.

container.tpl, test.tpl and test_a.tpl all three have {$smarty.now nocache}. Only the one in container.tpl updates every page refresh, in the other two files it stays the same.
Back to top
View user's profile Send private message
U.Tews
Administrator


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

PostPosted: Thu Nov 12, 2009 9:50 pm    Post subject: Reply with quote

I have to test that, may take a while.
Back to top
View user's profile Send private message
caoimhin
Smarty Rookie


Joined: 08 Nov 2009
Posts: 24
Location: Lebbeke, Belgium

PostPosted: Thu Nov 12, 2009 9:51 pm    Post subject: Reply with quote

No problem, just to let you know Smile
Back to top
View user's profile Send private message
U.Tews
Administrator


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

PostPosted: Thu Nov 12, 2009 10:50 pm    Post subject: Reply with quote

The fix for nocache code within child {block} tags is in the SVN now.
Back to top
View user's profile Send private message
caoimhin
Smarty Rookie


Joined: 08 Nov 2009
Posts: 24
Location: Lebbeke, Belgium

PostPosted: Thu Nov 12, 2009 11:16 pm    Post subject: Reply with quote

It works now, except one thing. If I use a nocache include {include file="test.tpl" nocache}, then I cannot use {$smarty.now nocache} in the test.tpl template. It will just display nothing then. When I use {$smarty.now} it is visible.
Back to top
View user's profile Send private message
U.Tews
Administrator


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

PostPosted: Sat Nov 14, 2009 4:19 pm    Post subject: Reply with quote

The fix is in the SVN now.
Back to top
View user's profile Send private message
caoimhin
Smarty Rookie


Joined: 08 Nov 2009
Posts: 24
Location: Lebbeke, Belgium

PostPosted: Mon Nov 16, 2009 8:34 am    Post subject: Reply with quote

Looks ok now, thnx ! I have another question, I will put it here but if you want me to create a new topic for that I will do that.

If I want to create a function with an unknown number of arguments, and I want them to use like {myFunction 1="abc" 2="def"}some text %1 %2{/myFunction}, how can I do that? And I noticed that I cannot use numeric values too. It's because I want to create a sprintf kind of function for Smarty Smile
Back to top
View user's profile Send private message
U.Tews
Administrator


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

PostPosted: Mon Nov 16, 2009 9:25 pm    Post subject: Reply with quote

I will enable the numeric values during the next couple of days.
Back to top
View user's profile Send private message
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 -> Smarty 3 All times are GMT
Goto page Previous  1, 2, 3  Next
Page 2 of 3

 
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