Hey,

I did the exact same thing.

I created an app_error.php and there I can ovverride the actions for
the errors like missingView, missingAction, even error404. I invoked
the RequestHandler there, so I can render the correct template.

For the layout I did what thatsgreat2345 suggested. I checked for a
mobile call and just switch the layout there. This is working very
well for me, as I don't know how to call $this->_outputMessage() and
use my layout as a parameter.

So it's working and even if it's not the best approach I like having a
custom Error Hanlder (which is the app_error file) and I could use
Sessions or other things here if I need this in the future :)

Thanks guys,

DD


On 10 Mrz., 08:41, thatsgreat2345 <[email protected]> wrote:
> What I would do is in your app_controller.php (if you don't have on
> make it) you can create a function probably in beforeFilter to check
> if it is mobile. Then you can set a variable like $this->isMobile and
> see if it's true or not wherever yo need it. Just something I thought
> about, maybe wait for other peoples input.
> On Mar 9, 7:36 pm, DigitalDude <[email protected]> wrote:
>
> > Hey,
>
> > I'm running into a really mean problem and I have no clue how to solve
> > this.
>
> > In my app I let the RequestHandler check if the Request comes from a
> > mobile phone. This works fine for all controllers and actions, except
> > the error pages!
>
> > After looking through the core code of cake and some reading in the
> > cookbook, I startet to setup a file calles app_error.php in which I
> > can overwrite functions like the "missingView" function, which renders
> > a file calles missing_view.ctp in the /views/errors directory. This is
> > the standard behaviour of cake, and that's fine for me.
>
> > The params array has thelayoutas a value with it, and the values
> > come from the core (cake/libs/view/view.php) for this special case.
>
> > So the ONLY thing I would need is a way to invoke the RequestHanlder
> > into my app_error.php file, check if there is a mobile request and if
> > YES change thelayoutund the view to be rendered. Both of those
> > things I already testetd (hardcoded) and they work fine.
>
> > So is there ANY chance of using the RequestHanlder in the
> > app_error.php?
>
> > I would be so happy if that could work...
>
> > Regards,
>
> > DD

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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