Could someone help me understand the relationship between the php control files and the twig template files, can you and how do you pass variables from the twig files to the php file to allow the php file to process the data in the variable.
I am trying to write an input box to go into the footer to collect email address for newsletter signup. I have got the input box and button in the foot via editing the footer.twig file, but I cannot get the variable data to pass to the php file for it to process the variable and submit the email address into the database.
if this isn’t possible them what is the process of an account registration where there must be a process to check the account email address as the system reports if the email address already exists
thanks in advanced for all your help
Done by javascript.ChristmasJones wrote: ↑Wed Oct 20, 2021 6:32 pmHello
Could someone help me understand the relationship between the php control files and the twig template files, can you and how do you pass variables from the twig files to the php file to allow the php file to process the data in the variable.
I am trying to write an input box to go into the footer to collect email address for newsletter signup. I have got the input box and button in the foot via editing the footer.twig file, but I cannot get the variable data to pass to the php file for it to process the variable and submit the email address into the database.
if this isn’t possible them what is the process of an account registration where there must be a process to check the account email address as the system reports if the email address already exists
thanks in advanced for all your help
Call with it the controller where you can handle the values (e.g. storing into the database).
What you are trying to achieve, is what you get with that: https://osworx.net/Newsletter-Pro-30
Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.
OC version. Could be achieved by using an Event Trigger: https://github.com/opencart/opencart/wiki/Events-System . In addition, you could refer to the catalog/controller/extension/advertise/google.php file on how to do that with the footer.ChristmasJones wrote: ↑Wed Oct 20, 2021 6:32 pmHello
Could someone help me understand the relationship between the php control files and the twig template files, can you and how do you pass variables from the twig files to the php file to allow the php file to process the data in the variable.
I am trying to write an input box to go into the footer to collect email address for newsletter signup. I have got the input box and button in the foot via editing the footer.twig file, but I cannot get the variable data to pass to the php file for it to process the variable and submit the email address into the database.
if this isn’t possible them what is the process of an account registration where there must be a process to check the account email address as the system reports if the email address already exists
thanks in advanced for all your help
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Professional OpenCart extensions, support and custom work.
Contact me via email or Skype by support@thekrotek.com
That's what I already wrote above.
Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.
OSWorX, I took a look at your extension with interest, but as I’m just starting up and trying to get the website up and running with as little cost as possible (money needs to be spent on machinery). I don’t really have the spare money for your extension. I appreciate that it will pay for itself in the long run but until I earn some money, what I have needs to be spent elsewhere
Thekrotek could you explain a bit more about using an AJAX script to get this to work as that sounds like it is what I’m looking for. Would the AJAX code be based in the TWIG file or would it be called from within the TWIG file?
A free solution to develop the idea has already been provided on my previous reply.ChristmasJones wrote: ↑Thu Oct 21, 2021 2:22 amThank you for all your responses.
OSWorX, I took a look at your extension with interest, but as I’m just starting up and trying to get the website up and running with as little cost as possible (money needs to be spent on machinery). I don’t really have the spare money for your extension. I appreciate that it will pay for itself in the long run but until I earn some money, what I have needs to be spent elsewhere
Thekrotek could you explain a bit more about using an AJAX script to get this to work as that sounds like it is what I’m looking for. Would the AJAX code be based in the TWIG file or would it be called from within the TWIG file?
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
I'm sorry, but your questions are not related to OpenCart at all. They are related to the basics of coding. Please, use resources like StackOverflow and JQuery tutorials to learn about AJAX.ChristmasJones wrote: ↑Thu Oct 21, 2021 2:22 amThekrotek could you explain a bit more about using an AJAX script to get this to work as that sounds like it is what I’m looking for. Would the AJAX code be based in the TWIG file or would it be called from within the TWIG file?
Professional OpenCart extensions, support and custom work.
Contact me via email or Skype by support@thekrotek.com
You should look up the MVC design pattern.ChristmasJones wrote: ↑Wed Oct 20, 2021 6:32 pmCould someone help me understand the relationship between the php control files and the twig template files, can you and how do you pass variables from the twig files to the php file to allow the php file to process the data in the variable.
But in very simple terms, it is the controller than runs and the twig is included at the bottom with a $data variable passed to it.
UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk
Code: Select all
$this->load->view
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Users browsing this forum: No registered users and 563 guests