Search code examples
phpopencart2.xopencart-moduleopencart2.3

How to pass data from Controller method to view in Opencart 2


I m developing my first module in Opencart. The version I m using is 2.3. In my controller I have the index method and another method who handles my form data. I want to make some validations not in the index method and if it has some errors I want to fill an array and pass it back to the view.Thanks.


Solution

  • Your can pass the errors in array and then that array should be assinged in a session variable then you can get the errors on your form.