Hello Trongate,
To build a CMS, is there any way to 404 error route in to default controller and how to view CMS url database content if there no module and controller?
How to 404 error route default controller.
4 years ago
4 years ago
#1
4 years ago
#2
Hi there,
You may need to rephrase your two questions better for me to understand exactly what you are after but let me have a guess at it...
The default 404 error message is sent to the Templates module where you will find the error_404($data) method, this will pass $data to a view file in templates/views/error_404.php. You could change this view file to what ever you want to display. Also, Trongate's Core.php file calls a private method called draw_error_page, which loads the same template as above.
This question makes no sense to me; 'how to view CMS url database content if there no module and controller?' My quick answer would be, you can't if it doesn't exist.
You may need to rephrase your two questions better for me to understand exactly what you are after but let me have a guess at it...
The default 404 error message is sent to the Templates module where you will find the error_404($data) method, this will pass $data to a view file in templates/views/error_404.php. You could change this view file to what ever you want to display. Also, Trongate's Core.php file calls a private method called draw_error_page, which loads the same template as above.
This question makes no sense to me; 'how to view CMS url database content if there no module and controller?' My quick answer would be, you can't if it doesn't exist.
4 years ago
#3
Yes would have to agree with DaFa on the CMS question.
Why would you have a table in the database and not have a module?
The purpose of the module, controller and view files, are for you to manage the table.
Why would you have a table in the database and not have a module?
The purpose of the module, controller and view files, are for you to manage the table.
4 years ago
#4
I don't really understand the question. If you're asking how to route 404 errors to the homepage then you could open error_404.php and then add a simple PHP redirect onto the top of the code:
3 years ago
#5
hello i will try this . but its not working show error .
if there is some user enter something to the url that is not exist . i wont to redirect them default controller.
if there is some user enter something to the url that is not exist . i wont to redirect them default controller.
3 years ago
#6
Hmm.. I think we have a language barrier we need to overcome - so I'll try keep this simple:
DC's suggestion is great - open error_404.php which resides in
DC's suggestion is great - open error_404.php which resides in
3 years ago
#7
I try this but there is error
3 years ago
#8
I cannot repeat the error.
Here's my process:
1). Create a Trongate app on localhost
2). Go to any invalid URL within that app
3). Check to see the red '404' error page
4). Open up error_404.php
5). Add the redirect function to the top of the error_404php file.
6). Hit 'Save'
Have I got that right?
Here's some code, showing you the top of error_404.php
Here's my process:
1). Create a Trongate app on localhost
2). Go to any invalid URL within that app
3). Check to see the red '404' error page
4). Open up error_404.php
5). Add the redirect function to the top of the error_404php file.
6). Hit 'Save'
Have I got that right?
Here's some code, showing you the top of error_404.php
3 years ago
#9
By the way... if you still have challenges with this then don't worry. I'll be glad to meet you on Skype, if that helps.
3 years ago
#10
I was able to reproduce the error on Trongate v1.3.3036
investobd, you can also try:
at the start of 'error_404.php' file
investobd, you can also try:
at the start of 'error_404.php' file