Thursday, January 21, 2010

Re: Forcing application/xhtml+xml on cake's responses

The setContent() method does not actually pass down HTTP headers. Just
do it manually with header().

You can still use basic PHP, not everything has to be the "Cake way".

On Jan 21, 9:02 am, John Andersen <j.andersen...@gmail.com> wrote:
> Not sure it applies to your issue, but maybe the CakePHP book at this
> page can help you:http://book.cakephp.org/view/206/Inserting-Well-Formatted-elements#do...
>
> Enjoy,
>    John
>
> On Jan 21, 6:00 pm, Mołot <molots...@gmail.com> wrote:
>
> > I use xhtml 1.1 on my pages (experimantal ones, mainly, so I just
> > can ;) ), so I want correct mimetype on them. I've tried:
>
> > lass AppController extends Controller {
> >         var $components = array('RequestHandler');
> >         function beforeFilter( ) {
> >                 $this->RequestHandler->setContent('xhtml', 'application/xhtml+xml');
> >         }
>
> > }
>
> > but Live HTTP Headers reports the content is returned as an text/html
> > anyway. I kinda can't find other options. Is there something in Cake I
> > don't know, or is it a bug in my Apache config? (in apache, mind, I
> > don't use any mimetype-related options)
>
> > Best regards
> > Molot

No comments: