How to show 404 Page from module's action

Talk about writing modules and plugins for CMS Made Simple, or about specific core functionality. This board is for PHP programmers that are contributing to CMSMS not for site developers
Post Reply
cve
Forum Members
Forum Members
Posts: 44
Joined: Wed Jul 07, 2010 10:54 am

How to show 404 Page from module's action

Post by cve »

Hi, I want to know how can I show 404 page to the user when in my frontend action of module e.x. action.order.php goes wrong ???
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: How to show 404 Page from module's action

Post by calguy1000 »

As of CMSMS 1.11+ you can

Code: Select all

throw new CmsError404Exception('message');
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
cve
Forum Members
Forum Members
Posts: 44
Joined: Wed Jul 07, 2010 10:54 am

Re: How to show 404 Page from module's action

Post by cve »

great... but what about versions prior to 1.11?
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: How to show 404 Page from module's action

Post by calguy1000 »

short answer: upgrade.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
cve
Forum Members
Forum Members
Posts: 44
Joined: Wed Jul 07, 2010 10:54 am

Re: How to show 404 Page from module's action

Post by cve »

My module must working on version 1.10.3, otherwise the upgrade to 1.11 is not that simple, cause many "standard" modules was not upgraded and are broken with 1.11 version...
Post Reply

Return to “Developers Discussion”