简体   繁体   English

如何从Controller方法传递数据以在Opencart 2中进行查看

[英]How to pass data from Controller method to view in Opencart 2

I m developing my first module in Opencart. 我正在用Opencart开发我的第一个模块。 The version I m using is 2.3. 我使用的版本是2.3。 In my controller I have the index method and another method who handles my form data. 在我的控制器中,我有index方法和另一个处理我的表单数据的方法。 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. 我想在索引方法中没有进行一些验证,如果它有一些错误,我想填充一个数组并将其传递回视图。

您可以在数组中传递错误,然后将该数组放入会话变量中,然后可以在表单上获取错误。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM