From 0097725ef28df75318ca6abf51e207c9abdf87b7 Mon Sep 17 00:00:00 2001 From: Mauro Tschiedel Date: Wed, 1 Sep 2021 08:22:12 -0300 Subject: [PATCH] Update in error status code Add example If you will add specific status code for the browser --- README.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 73deaad..2cb77d7 100644 --- a/README.md +++ b/README.md @@ -972,6 +972,12 @@ If you do not want a redirect, but want the error-page rendered on the current-u $request->setRewriteCallback('ErrorController@notFound'); ``` +If you will set the correct status for the browser error use: + +```php +SimpleRouter::response()->httpCode(404); +``` + ## Using custom exception handlers This is a basic example of an ExceptionHandler implementation (please see "[Easily overwrite route about to be loaded](#easily-overwrite-route-about-to-be-loaded)" for examples on how to change callback). @@ -2073,4 +2079,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. \ No newline at end of file +SOFTWARE.