Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Component custom 404 page #56

Open
sagikazarmark opened this issue Oct 28, 2014 · 5 comments
Open

Component custom 404 page #56

sagikazarmark opened this issue Oct 28, 2014 · 5 comments

Comments

@sagikazarmark
Copy link
Contributor

Currently only the root component has 404 page (or any other http exception page).

IMO the exceptions handled in index.php should look for the component's router first where the request went.

@WanWizard
Copy link
Contributor

The assumption has been that that an Application (with all it's components) is a unity, and if you have several (like an environment with a separate frontend and backend), you will have two applications.

I think it may be a better solution to treat those exceptions as events, and simply trigger an event from index.php when the exception occurs. You then have a generic solution, and every component, controller or even method can attach a custom eventhandler to deal with the exception.

@sagikazarmark
Copy link
Contributor Author

Hm, the assumption is a bit weird to me, but I can live with that. I am currently creating an admin component which can be itself an application and also can be a component of an other application. This way you can use this component for any sites wither having a public site or some sort of internal system (CRM, ERP, etc).

I am a bug fan of event-driven design, so I'm not against it, however I also like the exceptions so it would be good if a thrown http exception could be translated into an event.

@WanWizard
Copy link
Contributor

That is exactly the idea. You have an application, which contains one or more components, in a hierarchy. In your case, but have an application.

I didn't say "remove the exceptions", it said "handle the exception by triggering an event". Which I think is exactly what you suggest. 😀

@sagikazarmark
Copy link
Contributor Author

We are on the same line then. ;)

@WanWizard
Copy link
Contributor

Yup. "Great minds think alike". 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants