Hey Logan,

alright it seems like there are a couple of new ways to do this since
the last time I checked.

One of them is to put a create a file app/error.php that will be your
own ErrorHandler for all CakePHP errors. Checkout cake/libs/errors.php
if you need to know how this needs to look. You can also extend the
file there and only change some things for it.

For the project I'm doing right now (not working with plugins), I need
to load the Menu from a database, also when an error is rendered. Right
now I'm using the following solution to make all of my stuff inside
AppController execute for this:

http://cakephp.org/pastes/show/fc1d05b03ef263eab5dca2bf49b59b40

It should be the same process for doing it to themes and stuff.

Now there is another cool method you can use, which is to create a
function inside your AppController called apperror. If such a function
exists, error handling will be passed to this function. Then you need
to do $this->constructClasses() in order to get a fully workable
AppController (means, Models, Components, etc. get loaded).

The second approach is much shorter, but it also means that you don't
get the pretty cakephp errors anymore. So for debugging reasons I went
with the code in CakeBin above for now. But I might put something like
this in AppController:

class AppController extends Controller
{
       if (DEBUG>0)
       {
                function apperror($method, $messages)
                {
                       // Display User friendly error messages in here.
Maybe offer search feature for controllerMissing.
                ]

       }
}

I've not tested the code above, but I hope it would be valid ; ).

bye, Felix
PS: Let me know if that helped you out.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~----------~----~----~----~------~----~------~--~---

Reply via email to