Jump to content

Show error after redirections


el_caveman

Recommended Posts

Hello guys,

 

I'm fairly new to presta development

 

I need to create a module that allows the user to upload some files on his order.

Everything seems to be working nicely except the errors when the user uploads an invalid file.

 

What I'm trying to do is something like this

 

$this->errors[] = "invalid file";
Tools::redirectLink(Context::getContext()->link->getPageLink("History"));

And I can understand why i'ts not showing the error, and I have an idea on how to make it work.

My idea was to create an instance of the historyController and display it instead of doing a redirection, but I'm not sure if that is the best option, and I'm looking for some opinions around here.

 

Thanks for your help,

Francisco

 

Link to comment
Share on other sites

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

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...