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

Is it possible to call another function after smarty display

 
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 Development
View previous topic :: View next topic  
Author Message
jag.mmnb
Smarty n00b


Joined: 24 May 2014
Posts: 1

PostPosted: Sat May 24, 2014 8:50 am    Post subject: Is it possible to call another function after smarty display Reply with quote

I am trying to make users download a zip file but prior to that, they would have to fill out a form with some required details.

Basically, I am able to do it but the problem is, when the users submit the form, the page remain as is and the file is downloaded.

What I did was, I created a file that contains the form which calls another file/page that serves as the success page and when it goes to the success page, that's the time the file gets downloaded but as mentioned, the page remains the form page an the file is downloaded automatically.

In my code, I call the function that downloads the file first then the function that calls the smarty template that will be displayed is called after.

But the problem is, it seems like the 2nd function is not executed as all. At first I thought it's the php header() function that stops the code execution next to it but as I have read, the code after the header() function are still executed not unless exit is called.

I have also tried to call the function that would render the smarty page then the function to download the file but it doesn't work. It seems like the codes after the display() call are not executed at all?

Is there a way for me to achieve what I am trying to do?
Back to top
View user's profile Send private message
U.Tews
Administrator


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

PostPosted: Sat May 24, 2014 9:16 am    Post subject: Reply with quote

It is possible to continue working after display();
You must have some other problem in your logic.
Check the PHP error logs.
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 Development 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