Andrei K Posted December 14, 2014 Share Posted December 14, 2014 Hi, I have a download template with an integer field download_counter and file_link. The task is to increment counter every time user downloads the file. So, I tried the following code: wireSendFile($page->download_file_link); $page->$download_counter = $page->$download_counter + 1; $page->save(); It sends file but doesn't increment the counter. I have modified it: wireSendFile($page->download_file_link); $p = $pages->get($page->id); $p->$download_counter = $p->$download_counter + 1; $p->save(); Alas, result is the same. File being downloaded but counter remains unchanged. Any suggestions? Link to comment Share on other sites More sharing options...
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!Register a new account
Already have an account? Sign in here.Sign In Now